int SocketReaderRunnable::Execute() { if(!sSocketManager.GetEventBase()) { sLog.outError(" Couldn't start Socket worker thread. Event_base is wrong!"); return 1; } sLog.outString(" Socket worker thread is started"); uint32 counter = 0; while(!bStop) { sLog.outString(" Ping..."); if( event_base_loop(sSocketManager.GetEventBase(), EVLOOP_ONCE) == -1 ) { sLog.outError(" Critical error is occured in event_loot. Exit."); sSocketManager.DisconnectAll(); return 1; } counter++; if(counter > 100) { sLog.outString(" ...Pong"); counter = 0; } sSocketManager.ClearErasedSockets(); } sLog.outString(" Socket worker thread is finished"); return 1; }