[gtk+/broadway: 246/246] broadway: Enable TCP_NODELAY for output socket



commit 9a26fd25af21b10350f79b7d1049588880e40448
Author: Alexander Larsson <alexl redhat com>
Date:   Tue Mar 15 11:47:38 2011 +0100

    broadway: Enable TCP_NODELAY for output socket
    
    This makes us send data immediately, giving a much snappier
    over-network experience.

 gdk/broadway/broadway.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gdk/broadway/broadway.c b/gdk/broadway/broadway.c
index d5e944d..714905f 100644
--- a/gdk/broadway/broadway.c
+++ b/gdk/broadway/broadway.c
@@ -4,6 +4,10 @@
 #include <assert.h>
 #include <errno.h>
 #include <zlib.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
 
 #include "broadway.h"
 
@@ -540,12 +544,15 @@ BroadwayOutput *
 broadway_output_new(int fd, guint32 serial)
 {
   BroadwayOutput *output;
+  int flag = 1;
 
   output = g_new0 (BroadwayOutput, 1);
 
   output->fd = fd;
   output->serial = serial;
 
+  setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int));
+
   broadway_output_write_header (output);
 
   output->zfd = gzdopen(fd, "wb");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]