mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
net: initialize socket to avoid closing random fd's
This commit is contained in:
parent
895fbd768f
commit
96dbd381cf
2 changed files with 4 additions and 1 deletions
|
|
@ -682,6 +682,9 @@ bool CloseSocket(SOCKET& hSocket)
|
|||
#else
|
||||
int ret = close(hSocket);
|
||||
#endif
|
||||
if (ret) {
|
||||
LogPrintf("Socket close failed: %d. Error: %s\n", hSocket, NetworkErrorString(WSAGetLastError()));
|
||||
}
|
||||
hSocket = INVALID_SOCKET;
|
||||
return ret != SOCKET_ERROR;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue