You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2013/04/18 23:41:53 UTC

svn commit: r1469586 - /qpid/proton/trunk/proton-c/src/posix/driver.c

Author: tross
Date: Thu Apr 18 21:41:53 2013
New Revision: 1469586

URL: http://svn.apache.org/r1469586
Log:
PROTON-294 - Enable TCP_NODELAY on TCP connections.

Modified:
    qpid/proton/trunk/proton-c/src/posix/driver.c

Modified: qpid/proton/trunk/proton-c/src/posix/driver.c
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/posix/driver.c?rev=1469586&r1=1469585&r2=1469586&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/posix/driver.c (original)
+++ qpid/proton/trunk/proton-c/src/posix/driver.c Thu Apr 18 21:41:53 2013
@@ -26,6 +26,7 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
+#include <netinet/tcp.h>
 #include <netdb.h>
 #include <unistd.h>
 #include <fcntl.h>
@@ -257,6 +258,14 @@ static void pn_configure_sock(int sock) 
     if (fcntl(sock, F_SETFL, flags) < 0) {
         perror("fcntl");
     }
+
+    //
+    // Disable the Nagle algorithm on TCP connections.
+    //
+    int tcp_nodelay = 1;
+    if (setsockopt(sock, SOL_TCP, TCP_NODELAY, (void*) &tcp_nodelay, sizeof(tcp_nodelay)) < 0) {
+        perror("setsockopt");
+    }
 }
 
 pn_connector_t *pn_listener_accept(pn_listener_t *l)



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org