mirror of
https://github.com/debauchee/barrier.git
synced 2026-07-07 12:27:59 +08:00
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:
@@ -391,7 +391,13 @@ CClient*
|
||||
CClientApp::openClient(const CString& name, const CNetworkAddress& address, CScreen* screen, const CCryptoOptions& crypto)
|
||||
{
|
||||
CClient* client = new CClient(
|
||||
m_events, name, address, new CTCPSocketFactory(m_events), NULL, screen, crypto);
|
||||
m_events,
|
||||
name,
|
||||
address,
|
||||
new CTCPSocketFactory(m_events, getSocketMultiplexer()),
|
||||
NULL,
|
||||
screen,
|
||||
crypto);
|
||||
|
||||
try {
|
||||
m_events->adoptHandler(
|
||||
@@ -522,6 +528,7 @@ CClientApp::mainLoop()
|
||||
// create socket multiplexer. this must happen after daemonization
|
||||
// on unix because threads evaporate across a fork().
|
||||
CSocketMultiplexer multiplexer;
|
||||
setSocketMultiplexer(&multiplexer);
|
||||
|
||||
// start client, etc
|
||||
appUtil().startNode();
|
||||
|
||||
Reference in New Issue
Block a user