mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
UI tweaks, use BindListenPort to detect instance already running, setsockopt(SO_REUSEADDR) so can bind during TIME_WAIT after exit and restart
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@35 1a98c847-1fd6-4fd8-948a-caf3550aa51b
This commit is contained in:
11
util.cpp
11
util.cpp
@@ -53,6 +53,17 @@ public:
|
||||
for (int i = 0; i < CRYPTO_num_locks(); i++)
|
||||
delete ppmutexOpenSSL[i];
|
||||
OPENSSL_free(ppmutexOpenSSL);
|
||||
|
||||
// Close sockets
|
||||
foreach(CNode* pnode, vNodes)
|
||||
closesocket(pnode->hSocket);
|
||||
if (closesocket(hListenSocket) == SOCKET_ERROR)
|
||||
printf("closesocket(hListenSocket) failed with error %d\n", WSAGetLastError());
|
||||
|
||||
#ifdef __WXMSW__
|
||||
// Shutdown Windows Sockets
|
||||
WSACleanup();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
instance_of_cinit;
|
||||
|
||||
Reference in New Issue
Block a user