[Twisted-Python] twisted.conch.telnet example?

Stephen Hansen apt.shansen at gmail.com
Tue Jun 26 19:32:54 EDT 2007

>   class TelnetFactory(ClientFactory):
>       def buildProtocol(self, addr):
>           return TelnetTransport(TelnetPrinter)
>   reactor.connectTCP(host, port, TelnetFactory())
> For something line oriented, you might mix in LineReceiver (as
> StatefulTelnetProtocol does) or instantiate one directly yourself in a
> TelnetProtocol subclass and feed it bytes in your dataReceived
> implementation.
> Hope this helps,

Oh, perfect. That was very useful, thanks. I had a feeling the problem was
in  plugging the objects together properly in buildProtocol, but  just
couldn't see quite how to do it right.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20070626/86bd856f/attachment.htm 

More information about the Twisted-Python mailing list