Changeset View
Changeset View
Standalone View
Standalone View
src/net.cpp
Show First 20 Lines • Show All 1,208 Lines • ▼ Show 20 Lines | if (!IsSelectableSocket(hSocket)) { | ||||
LogPrintf("connection from %s dropped: non-selectable socket\n", | LogPrintf("connection from %s dropped: non-selectable socket\n", | ||||
addr.ToString()); | addr.ToString()); | ||||
CloseSocket(hSocket); | CloseSocket(hSocket); | ||||
return; | return; | ||||
} | } | ||||
// According to the internet TCP_NODELAY is not carried into accepted | // According to the internet TCP_NODELAY is not carried into accepted | ||||
// sockets on all platforms. Set it again here just to be sure. | // sockets on all platforms. Set it again here just to be sure. | ||||
int set = 1; | SetSocketNoDelay(hSocket); | ||||
#ifdef WIN32 | |||||
setsockopt(hSocket, IPPROTO_TCP, TCP_NODELAY, (const char *)&set, | |||||
sizeof(int)); | |||||
#else | |||||
setsockopt(hSocket, IPPROTO_TCP, TCP_NODELAY, (void *)&set, sizeof(int)); | |||||
#endif | |||||
if (IsBanned(addr) && !whitelisted) { | if (IsBanned(addr) && !whitelisted) { | ||||
LogPrint(BCLog::NET, "connection from %s dropped (banned)\n", | LogPrint(BCLog::NET, "connection from %s dropped (banned)\n", | ||||
addr.ToString()); | addr.ToString()); | ||||
CloseSocket(hSocket); | CloseSocket(hSocket); | ||||
return; | return; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,943 Lines • Show Last 20 Lines |