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

Andrew Bennetts andrew-twisted at puzzling.org
Tue Oct 28 20:37:47 EST 2003

On Tue, Oct 28, 2003 at 02:55:25PM -0000, Mark Evans wrote:
> As for local echo - there is no user interface here, it's
> a console app (daemon actually, I might try it as an NT
> service).  So we are talking stdin/stdout sort of thinking.
> The reason for the question about local echo is not that
> I can't do it one way or another, but I want to do it in
> a way that is compatible and elegant in TM.  LineReceiver
> may have something to do with that.

No, the telnet client protocol has nothing to do with local echo.  A
TelnetClient instance would be responsible for sending and receiving data
over the socket, and local echo would be handled by whatever is responsible
for sending and receiving data over stdout/stdin.

So, whatever is talking to your stdin/stdout (probably a protocol instance
passed to twisted.internet.stdio.StandardIO) would have a reference to the
TelnetClient instance, so when the stdio's protocol's dataReceived is
called, it would check, say, self.telnetclient.localEcho, and call
self.transport.write if true.  

So the telnet client is responsible for letting whatever is using it know
that localEcho is or isn't set; but the actual echoing is done elsewhere.
Perhaps this is what you meant :)


More information about the Twisted-Python mailing list