Revision: 4782
          http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4782&view=rev
Author:   ossman_
Date:     2011-11-08 12:12:02 +0000 (Tue, 08 Nov 2011)
Log Message:
-----------
Cork the outgoing TCP stream while we still have messages to process. This
allows more efficent use of the congestion window as we will send fewer packets.

Modified Paths:
--------------
    trunk/common/rfb/VNCSConnectionST.cxx

Modified: trunk/common/rfb/VNCSConnectionST.cxx
===================================================================
--- trunk/common/rfb/VNCSConnectionST.cxx       2011-11-08 12:10:55 UTC (rev 
4781)
+++ trunk/common/rfb/VNCSConnectionST.cxx       2011-11-08 12:12:02 UTC (rev 
4782)
@@ -17,6 +17,7 @@
  * USA.
  */
 
+#include <network/TcpSocket.h>
 #include <rfb/VNCSConnectionST.h>
 #include <rfb/LogWriter.h>
 #include <rfb/Security.h>
@@ -114,10 +115,17 @@
 
     inProcessMessages = true;
 
+    // Get the underlying TCP layer to build large packets if we send
+    // multiple small responses.
+    network::TcpSocket::cork(sock->getFd(), true);
+
     while (getInStream()->checkNoWait(1)) {
       processMsg();
     }
 
+    // Flush out everything in case we go idle after this.
+    network::TcpSocket::cork(sock->getFd(), false);
+
     inProcessMessages = false;
 
     // If there were anything requiring an update, try to send it here.

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

Reply via email to