MCPcopy Create free account
hub / github.com/SOUI2/soui / CleanupThread

Method CleanupThread

demo/httpsvr/GenericServer.cpp:208–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206
207
208void CGenericServer::CleanupThread(WSAEVENT Event, SOCKET s, NewConnectionTag* pNewConn, DWORD dwThreadID)
209{
210 if(Event)
211 WSACloseEvent(Event);
212 closesocket(s);
213 EnterCriticalSection(&cs);
214 delete pNewConn;
215 LeaveCriticalSection(&cs);
216
217 THREADLIST::iterator it;
218 it = find_if(ThreadList.begin(), ThreadList.end(), bind2nd(IDCompare(), dwThreadID));
219 if(it != ThreadList.end())
220 {
221 EnterCriticalSection(&_cs);
222 HandleList.push_back((*it).hThread);
223 ThreadList.erase(it);
224 LeaveCriticalSection(&_cs);
225 }
226 else
227 LogMessage(LOGFILENAME, _T("Thread not found in the list"), _T("ClientThread"));
228}
229
230
231

Callers 2

AcceptThreadMethod · 0.80
ClientThreadMethod · 0.80

Calls 4

IDCompareClass · 0.85
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected