Rob Shearman : rpcrt4: Set TCP_NODELAY on the socket for the ncacn_ip_tcp transport to reduce latency .

Alexandre Julliard julliard at wine.codeweavers.com
Wed Feb 28 08:19:00 CST 2007


Module: wine
Branch: master
Commit: 829dfa8052edea653074beeb12b5bda07dadb24d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=829dfa8052edea653074beeb12b5bda07dadb24d

Author: Rob Shearman <rob at codeweavers.com>
Date:   Tue Feb 27 18:14:03 2007 +0000

rpcrt4: Set TCP_NODELAY on the socket for the ncacn_ip_tcp transport to reduce latency.

---

 dlls/rpcrt4/rpc_transport.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c
index bd0a797..4d83670 100644
--- a/dlls/rpcrt4/rpc_transport.c
+++ b/dlls/rpcrt4/rpc_transport.c
@@ -43,6 +43,9 @@
 #ifdef HAVE_NETINET_IN_H
 # include <netinet/in.h>
 #endif
+#ifdef HAVE_NETINET_TCP_H
+# include <netinet/tcp.h>
+#endif
 #ifdef HAVE_ARPA_INET_H
 # include <arpa/inet.h>
 #endif
@@ -742,6 +745,8 @@ static RPC_STATUS rpcrt4_ncacn_ip_tcp_open(RpcConnection* Connection)
 
   for (ai_cur = ai; ai_cur; ai_cur = ai_cur->ai_next)
   {
+    int val;
+
     if (TRACE_ON(rpc))
     {
       char host[256];
@@ -765,6 +770,11 @@ static RPC_STATUS rpcrt4_ncacn_ip_tcp_open(RpcConnection* Connection)
       close(sock);
       continue;
     }
+
+    /* RPC depends on having minimal latency so disable the Nagle algorithm */
+    val = 1;
+    setsockopt(sock, SOL_TCP, TCP_NODELAY, &val, sizeof(val));
+
     tcpc->sock = sock;
 
     freeaddrinfo(ai);




More information about the wine-cvs mailing list