CServerSocket.cpp
void CServerSocket::removeConnection( int sockno )
{
   std::deque< int >::iterator fit = \
         std::find( connectedSockets.begin(), connectedSockets.end(), sockno );

   if( fit != connectedSockets.end() )
   {
      CTrace( cout, TRACE_PROCESS ) << \
         "-- CLIENT CONNECTION CLOSED [conn " << *fit << "]" << endl;

      close( sockno );

      // Notify the application
      cbClass->onConnectionClose( *fit );

      // Erase this connection from the list of current client connections
      connectedSockets.erase( fit );
   }
}
// Remove a closed socket from the list. Make sure it is really closed.
Remove a closed socket from the list. Make sure it is really closed.
Remove a closed socket from the list . Make sure it is really closed .
void CServerSocket::removeConnection( int sockno )
{
   std::deque< int >::iterator fit = \
         std::find( connectedSockets.begin(), connectedSockets.end(), sockno );
   if( fit != connectedSockets.end() )
   {
      CTrace( cout, TRACE_PROCESS ) << \
         "-- CLIENT CONNECTION CLOSED [conn " << *fit << "]" << endl;
      close( sockno );
      cbClass->onConnectionClose( *fit );
      connectedSockets.erase( fit );
   }
}
void CServerSocket :: removeConnection ( int sockno ) { std :: deque < int > :: iterator fit = std :: find ( connectedSockets . begin ( ) , connectedSockets . end ( ) , sockno ) ; if ( fit != connectedSockets . end ( ) ) { CTrace ( cout , TRACE_PROCESS ) << " " << * fit << " " << endl ; close ( sockno ) ; cbClass -> onConnectionClose ( * fit ) ; connectedSockets . erase ( fit ) ; } }
Remove a closed socket from the list.
Remove a closed socket from the list .
// Notify the application // Erase this connection from the list of current client connections