Patch by Jerry for issue 46:

- Unit test for sending file data from server to client.
- Removed singleton pattern from CSocketMultiplexer for easier unit testing.
- Incremented protocol version from 1.4 to 1.5 (new file chunk message).
- Storing pointer to CConfig instead of copying in CServer (so we can mock it).
- Created a common event queue for testing (timeout, quit event, etc).
- Fixed code style.
This commit is contained in:
Nick Bolton 2013-07-16 19:02:30 +00:00
parent 6f97f1d186
commit c368013f13
56 changed files with 830 additions and 165 deletions

View file

@ -29,6 +29,7 @@ class CMutex;
class CThread;
class ISocketMultiplexerJob;
class IEventQueue;
class CSocketMultiplexer;
//! TCP data socket
/*!
@ -36,8 +37,8 @@ A data socket using TCP.
*/
class CTCPSocket : public IDataSocket {
public:
CTCPSocket(IEventQueue* events);
CTCPSocket(IEventQueue* events, CArchSocket socket);
CTCPSocket(IEventQueue* events, CSocketMultiplexer* socketMultiplexer);
CTCPSocket(IEventQueue* events, CSocketMultiplexer* socketMultiplexer, CArchSocket socket);
~CTCPSocket();
// ISocket overrides
@ -87,6 +88,7 @@ private:
bool m_readable;
bool m_writable;
IEventQueue* m_events;
CSocketMultiplexer* m_socketMultiplexer;
};
#endif