[Twisted-Python] Simple Telnet Client - couldn't get answer form server
I try to get from standard telnet server answer. I connect to this server, and now dataReceived() should give me a full answer from server like: Ret Hat Linux relase: ... login:, but it does not. I would like to know how to connect to this server and grab this data. dataReceived gives me something like that: #' (translation in telnet codes: IAC DO TERMINAL_TYPE IAC DO SPEED IAC DO X_DISPALY_LOCATION IAC DO NEW_ENVI_OPTION ((hex)FF FD 18 FF FD 20 FF FD 23 FF FD 27)). What should I do with this. I try to transport a answers for this questions. Maybe i got a mistake in code, somthing i do in wrong way? Code I working on in attachment.
On Thu, 04 Aug 2005 15:48:08 +0200, Michał Tyde <ajchos@wp.pl> wrote:
I try to get from standard telnet server answer. I connect to this server, and now dataReceived() should give me a full answer from server like: Ret Hat Linux relase: ... login:, but it does not. I would like to know how to connect to this server and grab this data.
Read the Telnet RFC, and either implement the telnet protocol or use Twisted's telnet protocol and answer the various IAC requests, then save the non-protocol stuff in some buffer. Twisted's API for this is twisted.protocols.telnet.Telnet.processChunk'.
On Thu, 4 Aug 2005 10:07:48 -0400, glyph@divmod.com wrote:
On Thu, 04 Aug 2005 15:48:08 +0200, Michał Tyde <ajchos@wp.pl> wrote:
I try to get from standard telnet server answer. I connect to this server, and now dataReceived() should give me a full answer from server like: Ret Hat Linux relase: ... login:, but it does not. I would like to know how to connect to this server and grab this data.
Read the Telnet RFC, and either implement the telnet protocol or use Twisted's telnet protocol and answer the various IAC requests, then save the non-protocol stuff in some buffer. Twisted's API for this is twisted.protocols.telnet.Telnet.processChunk'.
And/Or use twisted.conch.telnet instead (which presents a completely different, but non-line-oriented API). Jp
participants (3)
-
glyph@divmod.com
-
Jp Calderone
-
Michał Tyde