int main(int argc, char* argv[]) { //WSAData wsaData; //WSAStartup(MAKEWORD(2, 2), &wsaData); ASockIOInit(); MsgLoop_Init(); Async_Init(); if(OptGetValue(argc-1, &argv[1], "play", NULL)) { bReplayMode = true; pLoop = MsgLoop_Create(); pLoop->Playback(CSGGameLoopCallback::GetSingleton(), OptGetValue(argc-1, &argv[1], "play", NULL)); } else { pLoop = MsgLoop_Create(); pLoop->Start(CSGGameLoopCallback::GetSingleton(), 1000, OptGetValue(argc-1, &argv[1], "record", NULL)); InitTCPServer(1980); getchar(); FinalTCPServer(); pLoop->Stop(); pLoop->Wait(); CSGGameLoopCallback::Cleanup(); } Async_Final(); MsgLoop_Final(); ASockIOFini(); //WSACleanup(); return 0; }
CStressManager::~CStressManager() { m_mapCases.clear(); if(m_hTimerQueue) { DeleteTimerQueue(m_hTimerQueue); m_hTimerQueue = NULL; } ASockIOFini(); A_MUTEX_DESTROY(&m_mtxLocker); }
~CAsyncIOInit() { KillWorkers(m_workers); FreeIoBufferPool(m_iopool); ASockIOFini(); }