예제 #1
0
void SocketConnection::readMessages( SocketMonitor& s )
{
  if( !m_pSession ) return;

  std::string msg;
  while( readMessage( msg ) )
  {
    try
    {
      m_pSession->next( msg, UtcTimeStamp() );
    }
    catch ( InvalidMessage& )
    {
      if( !m_pSession->isLoggedOn() )
        s.drop( m_socket );
    }
  }
}
예제 #2
0
 void onError( SocketMonitor& monitor, int socket )
 {
   m_strategy.onDisconnect( m_server, socket );
   monitor.drop( socket );
 }