Update of /cvsroot/playerstage/code/player/client_libs/libplayerc
In directory 
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20969/client_libs/libplayerc

Modified Files:
        client.c 
Log Message:
applied TCP_NODELAY patch

Index: client.c
===================================================================
RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/client.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -C2 -d -r1.77 -r1.78
*** client.c    21 May 2007 11:03:32 -0000      1.77
--- client.c    9 Jul 2007 16:55:27 -0000       1.78
***************
*** 43,46 ****
--- 43,49 ----
   * CVS: $Id$
   **************************************************************************/
+ #if HAVE_CONFIG_H
+   #include <config.h>
+ #endif
  
  #include <assert.h>
***************
*** 53,56 ****
--- 56,62 ----
  #include <signal.h>
  #include <netinet/in.h>
+ #if ENABLE_TCP_NODELAY
+   #include <netinet/tcp.h>
+ #endif
  #include <sys/socket.h>
  #include <sys/poll.h>
***************
*** 253,256 ****
--- 259,275 ----
    }
  
+ #if ENABLE_TCP_NODELAY
+   // Disable Nagel's algorithm for lower latency
+   {
+     int yes = 1;
+     if(setsockopt(client->sock, IPPROTO_TCP, TCP_NODELAY, &yes,
+                   sizeof(int)) == -1)
+     {
+       PLAYERC_ERR("failed to enable TCP_NODELAY - setsockopt failed");
+       return -1;
+     }
+   }
+ #endif
+ 
    // Construct server address
    entp = gethostbyname(client->host);


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to