本文整理汇总了C++中Protocol::Next方法的典型用法代码示例。如果您正苦于以下问题:C++ Protocol::Next方法的具体用法?C++ Protocol::Next怎么用?C++ Protocol::Next使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Protocol
的用法示例。
在下文中一共展示了Protocol::Next方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WorkerThread
DWORD WINAPI CompletionPortStackListener::WorkerThread(LPVOID obj)
{
CompletionPortStackListener* instance = (CompletionPortStackListener*)obj;
int loopCtr1 = 0;
stack<Structs::LP_JOBREQUEST> _jobList = instance->jobList;
SOCKET _socket;
while (true)
{
::WaitForSingleObject(instance->ghHasMessageEvent, INFINITE);
::WaitForSingleObject(instance->ghMutex, INFINITE);
loopCtr1++;
::WaitForSingleObject(instance->ghMutex, INFINITE);
int sz = instance->jobList.size();
if (sz > 0)
{
::WaitForSingleObject(instance->ghMutex2, INFINITE);
Structs::LP_JOBREQUEST job = instance->jobList.top();
instance->jobList.pop();
::ReleaseMutex(instance->ghMutex2);
//
//
if (job == NULL)
{
continue;
}
_socket = job->socket;
{
try
{
Protocol* p = instance->_protocol; //*itr;
if (p == NULL)
{
continue;
}
Structs::LP_JOBREQUEST jobresp = new Structs::JOBREQUEST();
jobresp->data = job->data;
jobresp->len = job->len;
jobresp->socket = job->socket;
p->AddMessage(_strdup(jobresp->data));
LPVOID res = p->Parse();
Structs::LP_JOBREQUEST nextJob = (Structs::LP_JOBREQUEST)p->Next();
if (nextJob != NULL)
{
nextJob->socket = jobresp->socket;
instance->inputStage->AddMessage(nextJob);
}
if (job != NULL)
{
//ZeroMemory(job, sizeof(Structs::JOBREQUEST));
//delete(job);
}
}
catch (...)
{
int x = 1;
}
}
}
if (instance->jobList.size() == 0)
{
::ResetEvent(instance->ghHasMessageEvent);
}
::ReleaseMutex(instance->ghMutex);
}
return 1;
}