ANSC_STATUS AnscDstoStopEngines ( ANSC_HANDLE hThisObject ) { ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS; PANSC_DAEMON_SERVER_TCP_OBJECT pMyObject = (PANSC_DAEMON_SERVER_TCP_OBJECT)hThisObject; PANSC_DAEMON_ENGINE_TCP_OBJECT pEngine = NULL; PSINGLE_LINK_ENTRY pSLinkEntry = NULL; AnscAcquireLock(&pMyObject->EngineQueueLock); pSLinkEntry = AnscQueueGetFirstEntry(&pMyObject->EngineQueue); while ( pSLinkEntry ) { pEngine = ACCESS_ANSC_DAEMON_ENGINE_TCP_OBJECT(pSLinkEntry); pSLinkEntry = AnscQueueGetNextEntry(pSLinkEntry); pEngine->Stop((ANSC_HANDLE)pEngine); } AnscReleaseLock(&pMyObject->EngineQueueLock); return ANSC_STATUS_SUCCESS; }
ANSC_STATUS AnscDetoRemove ( ANSC_HANDLE hThisObject ) { ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS; PANSC_DAEMON_ENGINE_TCP_OBJECT pMyObject = (PANSC_DAEMON_ENGINE_TCP_OBJECT)hThisObject; pMyObject->Stop ((ANSC_HANDLE)pMyObject); pMyObject->Reset((ANSC_HANDLE)pMyObject); AnscFreeEvent(&pMyObject->RecvEvent ); AnscFreeEvent(&pMyObject->SendEvent ); AnscFreeEvent(&pMyObject->NewSocketEvent ); AnscFreeLock (&pMyObject->RecvSocketSetLock); AnscFreeLock (&pMyObject->SendSocketSetLock); AnscFreeLock (&pMyObject->SocketTableLock ); AnscFreeLock (&pMyObject->PacketQueueLock ); AnscCoRemove((ANSC_HANDLE)pMyObject); return ANSC_STATUS_SUCCESS; }