refactored SecureSocket to use interface #4313

This commit is contained in:
Xinyu Hou 2015-01-14 17:24:45 +00:00 committed by XinyuHou
parent be2b87fd39
commit 141b778477
28 changed files with 484 additions and 158 deletions

View file

@ -38,7 +38,7 @@ class TCPSocket : public IDataSocket {
public:
TCPSocket(IEventQueue* events, SocketMultiplexer* socketMultiplexer);
TCPSocket(IEventQueue* events, SocketMultiplexer* socketMultiplexer, ArchSocket socket);
~TCPSocket();
virtual ~TCPSocket();
// ISocket overrides
virtual void bind(const NetworkAddress&);
@ -57,15 +57,19 @@ public:
// IDataSocket overrides
virtual void connect(const NetworkAddress&);
protected:
virtual void onConnected();
ArchSocket getSocket() { return m_socket; }
private:
void init();
void setJob(ISocketMultiplexerJob*);
ISocketMultiplexerJob* newJob();
ISocketMultiplexerJob*
newJob();
void sendConnectionFailedEvent(const char*);
void sendEvent(Event::Type);
void onConnected();
void onInputShutdown();
void onOutputShutdown();
void onDisconnected();