Hey there,

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
following.

This is the output of a regular Terminal session when connecting to the
Telnet Server:
#------
drudge:~ rothfuchs$ telnet localhost 8001
Trying ::1...
Connected to localhost.
Escape character is '^]'.

>MM
 USERID:0004
 PASSWORD:
#------

In my Twisted Client, I implemented dataReceived() to just do:
[Š]
def dataReceived(self, data):
ŠŠ..print 'received: %s'
ŠŠ..print
[Š]

and this is the result:
#------
drudge:Desktop rothfuchs$ p s12.py
received: 
>

received: MM
 USE

received: RID:
#------

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?

Thanks
Fabian


_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to