|
|
@ -386,6 +386,12 @@ CNode* ConnectNode(CAddress addrConnect, const char *pszDest) |
|
|
|
if (pszDest ? ConnectSocketByName(addrConnect, hSocket, pszDest, Params().GetDefaultPort(), nConnectTimeout, &proxyConnectionFailed) : |
|
|
|
if (pszDest ? ConnectSocketByName(addrConnect, hSocket, pszDest, Params().GetDefaultPort(), nConnectTimeout, &proxyConnectionFailed) : |
|
|
|
ConnectSocket(addrConnect, hSocket, nConnectTimeout, &proxyConnectionFailed)) |
|
|
|
ConnectSocket(addrConnect, hSocket, nConnectTimeout, &proxyConnectionFailed)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if (!IsSelectableSocket(hSocket)) { |
|
|
|
|
|
|
|
LogPrintf("Cannot create connection: non-selectable socket created (fd >= FD_SETSIZE ?)\n"); |
|
|
|
|
|
|
|
CloseSocket(hSocket); |
|
|
|
|
|
|
|
return NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
addrman.Attempt(addrConnect); |
|
|
|
addrman.Attempt(addrConnect); |
|
|
|
|
|
|
|
|
|
|
|
// Add node
|
|
|
|
// Add node
|
|
|
@ -949,6 +955,11 @@ void ThreadSocketHandler() |
|
|
|
if (nErr != WSAEWOULDBLOCK) |
|
|
|
if (nErr != WSAEWOULDBLOCK) |
|
|
|
LogPrintf("socket error accept failed: %s\n", NetworkErrorString(nErr)); |
|
|
|
LogPrintf("socket error accept failed: %s\n", NetworkErrorString(nErr)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else if (!IsSelectableSocket(hSocket)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
LogPrintf("connection from %s dropped: non-selectable socket\n", addr.ToString()); |
|
|
|
|
|
|
|
CloseSocket(hSocket); |
|
|
|
|
|
|
|
} |
|
|
|
else if (nInbound >= nMaxInbound) |
|
|
|
else if (nInbound >= nMaxInbound) |
|
|
|
{ |
|
|
|
{ |
|
|
|
LogPrint("net", "connection from %s dropped (full)\n", addr.ToString()); |
|
|
|
LogPrint("net", "connection from %s dropped (full)\n", addr.ToString()); |
|
|
@ -1597,6 +1608,13 @@ bool BindListenPort(const CService &addrBind, string& strError, bool fWhiteliste |
|
|
|
LogPrintf("%s\n", strError); |
|
|
|
LogPrintf("%s\n", strError); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!IsSelectableSocket(hListenSocket)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
strError = "Error: Couldn't create a listenable socket for incoming connections"; |
|
|
|
|
|
|
|
LogPrintf("%s\n", strError); |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef WIN32 |
|
|
|
#ifndef WIN32 |
|
|
|
#ifdef SO_NOSIGPIPE |
|
|
|
#ifdef SO_NOSIGPIPE |
|
|
|