[net] Added SetSocketNoDelay() utility function

This commit is contained in:
Thomas Snider
2017-03-22 22:02:02 -07:00
parent 02d64bd929
commit ad415bc16a
3 changed files with 12 additions and 12 deletions

View File

@@ -1069,12 +1069,7 @@ void CConnman::AcceptConnection(const ListenSocket& hListenSocket) {
// According to the internet TCP_NODELAY is not carried into accepted sockets
// on all platforms. Set it again here just to be sure.
int set = 1;
#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
SetSocketNoDelay(hSocket);
if (IsBanned(addr) && !whitelisted)
{