aboutsummaryrefslogtreecommitdiff
path: root/src/netbase.cpp
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2018-02-01 10:29:15 -0500
committerCory Fields <cory-nospam-@coryfields.com>2018-02-01 11:31:27 -0500
commit96dbd381cf0ded169406bab3b1ba911a13d563c5 (patch)
tree03d9a1dcbe0a5fcef8f18ce5f859f3e57395550a /src/netbase.cpp
parent895fbd768f0c89cea3f78acac58b233d4e3a145e (diff)
net: initialize socket to avoid closing random fd's
Diffstat (limited to 'src/netbase.cpp')
-rw-r--r--src/netbase.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp
index 276b2f4dc2..d51277c495 100644
--- a/src/netbase.cpp
+++ b/src/netbase.cpp
@@ -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;
}