Update of /cvsroot/playerstage/code/player/libplayertcp
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20969/libplayertcp
Modified Files:
playertcp.cc remote_driver.cc
Log Message:
applied TCP_NODELAY patch
Index: remote_driver.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayertcp/remote_driver.cc,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** remote_driver.cc 16 Apr 2006 23:41:35 -0000 1.16
--- remote_driver.cc 9 Jul 2007 16:55:27 -0000 1.17
***************
*** 21,24 ****
--- 21,28 ----
*/
+ #if HAVE_CONFIG_H
+ #include <config.h>
+ #endif
+
#include <errno.h>
#include <sys/types.h>
***************
*** 26,29 ****
--- 30,37 ----
#include <fcntl.h>
+ #if ENABLE_TCP_NODELAY
+ #include <netinet/tcp.h>
+ #endif
+
#include <libplayercore/globals.h>
#include <libplayercore/error.h>
***************
*** 103,106 ****
--- 111,125 ----
}
+ #if ENABLE_TCP_NODELAY
+ // Disable Nagel's algorithm for lower latency
+ int yes = 1;
+ if( setsockopt(this->sock, IPPROTO_TCP, TCP_NODELAY, &yes,
+ sizeof(int)) == -1 )
+ {
+ PLAYER_ERROR("failed to enable TCP_NODELAY - setsockopt failed");
+ return(-1);
+ }
+ #endif
+
// Get the banner.
GlobalTime->GetTimeDouble(&t1);
Index: playertcp.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayertcp/playertcp.cc,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** playertcp.cc 14 Mar 2007 16:41:51 -0000 1.53
--- playertcp.cc 9 Jul 2007 16:55:27 -0000 1.54
***************
*** 31,34 ****
--- 31,37 ----
#include <unistd.h>
#include <fcntl.h>
+ #if ENABLE_TCP_NODELAY
+ #include <netinet/tcp.h>
+ #endif
#if HAVE_ZLIB_H
***************
*** 291,294 ****
--- 294,308 ----
}
+ #if ENABLE_TCP_NODELAY
+ // Disable Nagel's algorithm for lower latency
+ int yes = 1;
+ if( setsockopt(newsock, IPPROTO_TCP, TCP_NODELAY, &yes,
+ sizeof(int)) == -1 )
+ {
+ PLAYER_ERROR("failed to enable TCP_NODELAY - setsockopt failed");
+ return(-1);
+ }
+ #endif
+
// make the socket non-blocking
if(fcntl(newsock, F_SETFL, O_NONBLOCK) == -1)
-------------------------------------------------------------------------
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