static void *thread_proc(void* param) #endif { CSocketIOPtr s = (CSocketIO*)param; cvs::string line; int v=1; s->setnodelay(true); s->blocking(true); #ifdef _WIN32 if(g_bTestMode) printf("Starting thread %08x\n",GetCurrentThreadId()); #endif while(s->getline(line)) { if(!ParseControlCommand(s,line.c_str())) break; } CloseControlClient(s); #ifdef _WIN32 if(g_bTestMode) printf("Terminating thread %08x\n",GetCurrentThreadId()); #endif #ifndef _WIN32 return NULL; #endif }
VOID CManagerThread::CheckAndOperateControlCommand() { ControlCommand controlCommand; CheckControlCommand(controlCommand); if (controlCommand.size() < 1) { return; } DebugLog("Request ready command to all manager"); ST_PROTO_ROOT *pProtoRoot = new (std::nothrow) ST_PROTO_ROOT(); if (!pProtoRoot) { return; } ParseControlCommand(controlCommand, pProtoRoot); std::string strSendData; BuildSendMsg(strSendData, pProtoRoot); DWORD dwRet; dwRet = BroadCastMsgToManager(strSendData); if (dwRet != E_RET_SUCCESS) { return; } }