<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><div>Hey there,</div><div><br></div><div>I'm currently implementing a Telnet Client, which is actually talking to a Console Server mapping Telnet to an RS232 interface.</div><div>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.</div><div>I guess the best way to introduce the problem is to show an example in the following.</div><div><br></div><div>This is the output of a regular Terminal session when connecting to the Telnet Server:</div><div>#------</div><div><div>drudge:~ rothfuchs$ telnet localhost 8001</div><div>Trying ::1...</div><div>Connected to localhost.</div><div>Escape character is '^]'.</div><div><br></div><div>&gt;MM</div><div>&nbsp;USERID:0004</div><div>&nbsp;PASSWORD:</div><div>#------</div></div><div><br></div><div>In my Twisted Client, I implemented dataReceived() to just do:</div><div>[&#8230;]</div><div>def dataReceived(self, data):</div><div>&#8230;&#8230;..print 'received: %s'</div><div>&#8230;&#8230;..print</div><div>[&#8230;]</div><div><br></div><div>and this is the result:</div><div>#------</div><div>drudge:Desktop rothfuchs$ p s12.py&nbsp;</div><div>received:&nbsp;</div><div>&gt;</div><div><br></div><div>received: MM</div><div>&nbsp;USE</div><div><br></div><div>received: RID:</div><div>#------</div><div><br></div><div>I also ran a tcpdump to confirm &#8211; 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.</div><div><br></div><div>My question: is there any best practice for buffer techniques here?</div><div><br></div><div>Thanks</div><div>Fabian</div></body></html>