Example #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 );
    }
  }
}
Example #2
0
 void onError( SocketMonitor& monitor, int socket )
 {
   m_strategy.onDisconnect( m_server, socket );
   monitor.drop( socket );
 }