Logo Search packages:      
Sourcecode: kmess version File versions  Download package

void DirectConnectionPool::clearPending (  ) 

Remove all connections from the list.

Definition at line 174 of file directconnectionpool.cpp.

References DirectConnectionBase::getRemoteIp(), and DirectConnectionBase::getRemotePort().

Referenced by slotConnectionAuthorized(), and slotConnectionEstablished().

{
  // Avoid unwanted debug messages..
  if( pendingConnections_.isEmpty() && unauthorizedConnections_.isEmpty() )
  {
    return;
  }

#ifdef KMESSDEBUG_DIRECTCONNECTION_GENERAL
  kDebug() << "Removing pending sockets.";
#endif

  // Tell all other pending connections to abort
  foreach( DirectConnectionBase *pendingConnection, pendingConnections_ )
  {
#ifdef KMESSDEBUG_DIRECTCONNECTION_GENERAL
    kDebug() << "Deleting pending connection to peer "
             << pendingConnection->getRemoteIp() << ":" << pendingConnection->getRemotePort() << endl;
#endif

    pendingConnection->deleteLater();  // delete should not be called from a slot.
  }

  // Tell all other unauthorized connections to abort
  foreach( DirectConnectionBase *unauthorizedConnection, unauthorizedConnections_ )
  {
#ifdef KMESSDEBUG_DIRECTCONNECTION_GENERAL
    kDebug() << "Deleting unauthorized connection to peer "
             << unauthorizedConnection->getRemoteIp() << ":" << unauthorizedConnection->getRemotePort() << endl;
#endif

    unauthorizedConnection->deleteLater();  // delete should not be called from a slot.
  }

  // Clear the list
  pendingConnections_.clear();
  unauthorizedConnections_.clear();
}


Generated by  Doxygen 1.6.0   Back to index