Revision: 4781 http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4781&view=rev Author: ossman_ Date: 2011-11-08 12:10:55 +0000 (Tue, 08 Nov 2011) Log Message: ----------- Expose Linux' cork functionality which allows us to aggregate TCP data in a controlled manner. Unfortunately there is no equivalent for Windows.
Modified Paths: -------------- trunk/common/network/TcpSocket.cxx trunk/common/network/TcpSocket.h Modified: trunk/common/network/TcpSocket.cxx =================================================================== --- trunk/common/network/TcpSocket.cxx 2011-11-08 10:32:05 UTC (rev 4780) +++ trunk/common/network/TcpSocket.cxx 2011-11-08 12:10:55 UTC (rev 4781) @@ -309,6 +309,17 @@ return true; } +bool TcpSocket::cork(int sock, bool enable) { +#ifndef TCP_CORK + return false; +#else + int one = enable ? 1 : 0; + if (setsockopt(sock, IPPROTO_TCP, TCP_CORK, (char *)&one, sizeof(one)) < 0) + return false; + return true; +#endif +} + bool TcpSocket::isSocket(int sock) { struct sockaddr_in info; Modified: trunk/common/network/TcpSocket.h =================================================================== --- trunk/common/network/TcpSocket.h 2011-11-08 10:32:05 UTC (rev 4780) +++ trunk/common/network/TcpSocket.h 2011-11-08 12:10:55 UTC (rev 4781) @@ -56,6 +56,7 @@ virtual void shutdown(); static bool enableNagles(int sock, bool enable); + static bool cork(int sock, bool enable); static bool isSocket(int sock); static bool isConnected(int sock); static int getSockPort(int sock); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ Tigervnc-commits mailing list Tigervnc-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tigervnc-commits