summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Globals.h1
-rw-r--r--src/OSSupport/ServerHandleImpl.cpp3
2 files changed, 4 insertions, 0 deletions
diff --git a/src/Globals.h b/src/Globals.h
index 0b6ff8ac5..7c2af3d11 100644
--- a/src/Globals.h
+++ b/src/Globals.h
@@ -98,6 +98,7 @@
#include <arpa/inet.h>
#include <netinet/in.h>
+ #include <netinet/tcp.h>
#include <sys/socket.h>
#include <unistd.h>
#endif
diff --git a/src/OSSupport/ServerHandleImpl.cpp b/src/OSSupport/ServerHandleImpl.cpp
index e68f82757..669a0f83f 100644
--- a/src/OSSupport/ServerHandleImpl.cpp
+++ b/src/OSSupport/ServerHandleImpl.cpp
@@ -328,6 +328,9 @@ void cServerHandleImpl::Callback(evconnlistener * a_Listener, evutil_socket_t a_
return;
}
+ const int one = 1;
+ setsockopt(a_Socket, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<const char *>(&one), sizeof(one));
+
// Create a new cTCPLink for the incoming connection:
cTCPLinkImplPtr Link = std::make_shared<cTCPLinkImpl>(a_Socket, LinkCallbacks, Self->m_SelfPtr, a_Addr, static_cast<socklen_t>(a_Len));
{