void SocketReaderRunnable::run() { if(!sSocketManager.GetEventBase()) { sLog.outError(" Couldn't start Socket worker thread. Event_base is wrong!"); return; } sLog.outString(" Socket worker thread is started"); while(!bStop) { Sleep(10); if( event_base_loop(sSocketManager.GetEventBase(), EVLOOP_ONCE) == -1 ) { sLog.outError(" Critical error is occured in event_loot. Exit."); sSocketManager.DisconnectAll(); return; } } sLog.outString(" Socket worker thread is finished"); }