[Twisted-Python] Re: Telnet Client as Line Receiver?

Christopher Armstrong radix at twistedmatrix.com
Wed Oct 29 01:58:37 EST 2003

On Tue, Oct 28, 2003 at 02:55:25PM -0000, Mark Evans wrote:

> do you think that a telnet client should be a subclass of
> LineReceiver?

Hmm.. Well, I think it should probably expose a line-based interface,
but you may have to implement it yourself without
LineReceiver. "Prompts" are ubiquitous in telnet-based services, so
you're going to have to handle that case. You can never tell when a
prompt will be received, so using LineReceiver at all is
futile. Perhaps there could be two event-methods, lineReceived and
promptReceived, where promptReceived is called when input has been
received that matches a user-defined "prompt pattern", and no data has
been received for N.n seconds after that input was received?

I recommend just implementing it however you need it to be implemented
and posting a patch to the bug tracker. Someone (perhaps me) will take
a look at it.

 Twisted | Christopher Armstrong: International Man of Twistery
  Radix  |          Release Manager,  Twisted Project
---------+     http://twistedmatrix.com/users/radix.twistd/

More information about the Twisted-Python mailing list