[Twisted-Python] twisted.conch.telnet example?
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
> 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...
More information about the Twisted-Python