|
|
@ -660,12 +660,12 @@ void ThreadSocketHandler(void* parg)
|
|
|
|
printf("ThreadSocketHandler exited\n");
|
|
|
|
printf("ThreadSocketHandler exited\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static list<CNode*> vNodesDisconnected;
|
|
|
|
|
|
|
|
|
|
|
|
void ThreadSocketHandler2(void* parg)
|
|
|
|
void ThreadSocketHandler2(void* parg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("ThreadSocketHandler started\n");
|
|
|
|
printf("ThreadSocketHandler started\n");
|
|
|
|
list<CNode*> vNodesDisconnected;
|
|
|
|
|
|
|
|
unsigned int nPrevNodeCount = 0;
|
|
|
|
unsigned int nPrevNodeCount = 0;
|
|
|
|
|
|
|
|
|
|
|
|
loop
|
|
|
|
loop
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//
|
|
|
|
//
|
|
|
@ -1992,6 +1992,7 @@ bool StopNode()
|
|
|
|
Sleep(20);
|
|
|
|
Sleep(20);
|
|
|
|
Sleep(50);
|
|
|
|
Sleep(50);
|
|
|
|
DumpAddresses();
|
|
|
|
DumpAddresses();
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2012,6 +2013,18 @@ public:
|
|
|
|
if (closesocket(hListenSocket) == SOCKET_ERROR)
|
|
|
|
if (closesocket(hListenSocket) == SOCKET_ERROR)
|
|
|
|
printf("closesocket(hListenSocket) failed with error %d\n", WSAGetLastError());
|
|
|
|
printf("closesocket(hListenSocket) failed with error %d\n", WSAGetLastError());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// clean up some globals (to help leak detection)
|
|
|
|
|
|
|
|
BOOST_FOREACH(CNode *pnode, vNodes)
|
|
|
|
|
|
|
|
delete pnode;
|
|
|
|
|
|
|
|
BOOST_FOREACH(CNode *pnode, vNodesDisconnected)
|
|
|
|
|
|
|
|
delete pnode;
|
|
|
|
|
|
|
|
vNodes.clear();
|
|
|
|
|
|
|
|
vNodesDisconnected.clear();
|
|
|
|
|
|
|
|
delete semOutbound;
|
|
|
|
|
|
|
|
semOutbound = NULL;
|
|
|
|
|
|
|
|
delete pnodeLocalHost;
|
|
|
|
|
|
|
|
pnodeLocalHost = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef WIN32
|
|
|
|
#ifdef WIN32
|
|
|
|
// Shutdown Windows Sockets
|
|
|
|
// Shutdown Windows Sockets
|
|
|
|
WSACleanup();
|
|
|
|
WSACleanup();
|
|
|
|