[Twisted-Python] flushing the transport

sir shz sir.shz at gmail.com
Tue Apr 26 17:30:36 MDT 2005


Hi, I'm just starting to write a simple client, whose protocol inherits from
basic.LineReceiver:

class MyClientProtocol(basic.LineReceiver):
     def connectionMade(self):
          stdout.write("\nconnectionMade\n")
          self.transport.write("test\r\n")
          # time.sleep(10)

now if I un-comment the "time.sleep(10)", the server doesn't receive the
"test\r\n" message until
10 seconds later, basically after the connectionMade() returns. Is there
anyway to "flush" the buffer so
the transport will send the "test\r\n" right away?

Thanks.

Z.






More information about the Twisted-Python mailing list