[Checkins] SVN: zc.ngi/trunk/src/zc/ngi/adapters. Write messages as a single string to avoid triggering nagle's

Jim Fulton jim at zope.com
Tue Jan 19 18:37:46 EST 2010


Log message for revision 108279:
  Write messages as a single string to avoid triggering nagle's
  algorithm (and to avoid sending small packets in TCP_NODELAY is set).
  

Changed:
  U   zc.ngi/trunk/src/zc/ngi/adapters.py
  U   zc.ngi/trunk/src/zc/ngi/adapters.txt

-=-
Modified: zc.ngi/trunk/src/zc/ngi/adapters.py
===================================================================
--- zc.ngi/trunk/src/zc/ngi/adapters.py	2010-01-19 23:30:19 UTC (rev 108278)
+++ zc.ngi/trunk/src/zc/ngi/adapters.py	2010-01-19 23:37:46 UTC (rev 108279)
@@ -91,6 +91,4 @@
         if message is None:
             self.connection.write('\xff\xff\xff\xff')
         else:
-            self.connection.write(struct.pack(">I", len(message)))
-            self.connection.write(message)
-    
+            self.connection.write(struct.pack(">I", len(message))+message)

Modified: zc.ngi/trunk/src/zc/ngi/adapters.txt
===================================================================
--- zc.ngi/trunk/src/zc/ngi/adapters.txt	2010-01-19 23:30:19 UTC (rev 108278)
+++ zc.ngi/trunk/src/zc/ngi/adapters.txt	2010-01-19 23:37:46 UTC (rev 108279)
@@ -98,8 +98,7 @@
 message size:
 
     >>> adapter.write(message1)
-    -> '\x00\x00\x00\x19'
-    -> 'Hello\nWorld!\nHow are you?'
+    -> '\x00\x00\x00\x19Hello\nWorld!\nHow are you?'
 
 Null messages
 -------------



More information about the checkins mailing list