BOOL CUdpServer::Stop() { if(!CheckStoping()) return FALSE; CloseListenSocket(); WaitForDetectorThreadEnd(); DisconnectClientSocket(); WaitForClientSocketClose(); WaitForWorkerThreadEnd(); ReleaseClientSocket(); FireServerShutdown(); ReleaseFreeSocket(); ReleaseFreeBuffer(); CloseCompletePort(); Reset(); return TRUE; }
BOOL CTcpServer::Stop() { if(!CheckStoping()) return FALSE; CloseListenSocket(); ::WaitWithMessageLoop(150); WaitForAcceptSocketClose(); DisconnectClientSocket(); WaitForClientSocketClose(); WaitForWorkerThreadEnd(); ReleaseClientSocket(); FireServerShutdown(); ReleaseFreeSocket(); ReleaseFreeBuffer(); CloseCompletePort(); Reset(); return TRUE; }
BOOL CIocpServer::Stop() { if(!CheckStoping()) return FALSE; WaitForAcceptThreadEnd(); WaitForWorkerThreadEnd(); CloseClientSocket(); CloseListenSocket(); FireServerShutdown(); ReleaseFreeSocket(); ReleaseFreeBuffer(); CloseCompletePort(); Reset(); m_enState = SS_STOPED; return TRUE; }