[Twisted-Python] dataReveived() buffer best practice?
fabian.rothfuchs at googlemail.com
Thu Oct 6 12:22:18 EDT 2011
I'm currently implementing a Telnet Client, which is actually talking to a
Console Server mapping Telnet to an RS232 interface.
Further I'm using Twisted's conch.telnet lib to build that client, and I got
a little situation here where I wonder if there's already a best practice.
I guess the best way to introduce the problem is to show an example in the
This is the output of a regular Terminal session when connecting to the
drudge:~ rothfuchs$ telnet localhost 8001
Connected to localhost.
Escape character is '^]'.
In my Twisted Client, I implemented dataReceived() to just do:
def dataReceived(self, data):
..print 'received: %s'
and this is the result:
drudge:Desktop rothfuchs$ p s12.py
I also ran a tcpdump to confirm The opposite server is obviously pushing
content to the socket in arbitrary frequencies, ending up in my
dataReceived() method to get called arbitrarily as well.
My question: is there any best practice for buffer techniques here?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python