[Twisted-Python] RE: [Python-Twisted] How to write a simple telnet client?

Henning.Ramm at mediapro-gmbh.de Henning.Ramm at mediapro-gmbh.de
Fri Sep 23 11:38:11 MDT 2005


>Please look at my posts from 11.08.2005 - What is wrong with this
>instance (topic). I have send there a code of my telnet client. I don't
>remember what was wrong, but i solve most of problems, so if 
>you had any
>questions e-mail me. I think that my code is what You need. This is a
>very simple client and i have developed him.

I played around with your code at http://twistedmatrix.com/pipermail/twisted-python/2005-August/011115.html, even if I don't understand polish. ;-)

I didn't expect that one must handle control codes (your function reponseFunct), I expected the protocol to handle that for me, but anyway, that was no problem (i.e. you solved it before). And with your code I could even switch off the echo (your next thread).

What I don't understand is how to 'inject' some commands and collect their result.
What you tried in your "command" function in __main__ can't work, because the protocol has no transport.
I don't understand how to get at the Factory's actual protocol instance and its transport.

I could 'hardcode' a list of commands in my protocol class, but that would make no sense...

Probably I shouldn't use a ClientFactory but something else.

Best regards,
Henning Hraban Ramm
Südkurier Medienhaus / MediaPro
Support/Admin/Development Dept.




More information about the Twisted-Python mailing list