Move CloseSocket out of SetSocketNonBlocking and pass SOCKET by const reference in SetSocket* functions

This commit is contained in:
Dag Robole
2017-07-18 16:24:46 +02:00
parent 7b6e8bc442
commit 05e023f2ec
4 changed files with 10 additions and 9 deletions

View File

@@ -2076,6 +2076,7 @@ bool CConnman::BindListenPort(const CService &addrBind, std::string& strError, b
// Set to non-blocking, incoming connections will also inherit this
if (!SetSocketNonBlocking(hListenSocket, true)) {
CloseSocket(hListenSocket);
strError = strprintf("BindListenPort: Setting listening socket to non-blocking failed, error %s\n", NetworkErrorString(WSAGetLastError()));
LogPrintf("%s\n", strError);
return false;