aboutsummaryrefslogtreecommitdiff
path: root/src/connectionmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/connectionmanager.cpp')
-rw-r--r--src/connectionmanager.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/connectionmanager.cpp b/src/connectionmanager.cpp
index 3e9f1a8..367b9d7 100644
--- a/src/connectionmanager.cpp
+++ b/src/connectionmanager.cpp
@@ -195,6 +195,7 @@ bool ConnectionManager::scanConnections( int nTimeout, bool bForceTimeout )
195 lActive.erase( l ); 195 lActive.erase( l );
196 continue; 196 continue;
197 } 197 }
198 (*i)->poll();
198 if( (*i)->hasOutput() ) 199 if( (*i)->hasOutput() )
199 { 200 {
200 (*i)->writeOutput(); 201 (*i)->writeOutput();
@@ -324,6 +325,23 @@ bool ConnectionManager::addConnection( int nSocket )
324 return true; 325 return true;
325} 326}
326 327
328void ConnectionManager::connect(
329 const char *lpAddress,
330 int nPort,
331 int nProtocolPort
332 )
333{
334 Connection *pCon = getInactiveConnection();
335 pCon->open( lpAddress, nPort );
336 int nSocket = pCon->getSocket();
337 FD_SET( nSocket, &fdActive );
338
339 pMonitor->onNewClientConnection( pCon, nProtocolPort );
340 pCon->getProtocol()->onNewClientConnection();
341
342 lActive.insert( lActive.end(), pCon );
343}
344
327Connection *ConnectionManager::getInactiveConnection() 345Connection *ConnectionManager::getInactiveConnection()
328{ 346{
329 if( lInactive.empty() ) 347 if( lInactive.empty() )