[Twisted-Python] struggling with twisted telnet

Andrew Roden andrew.roden at gmail.com
Wed Aug 8 07:27:36 MDT 2007


The answer is no I wasn't running it with twistd as I didn't need to with
the ssh one... having now run it with twistd I can see the exceptions it
throws but I have absolutely no clue how to go about rectifying them :(
>From what I can make out the main issue is with no terminal size being set
which from the demo_insults.tac looks like it's set in my class that deals
with connections associating it with insults.TerminalProtocol (eg. class
DemoProtocol(insults.TerminalProtocol): ) however, I am dealing with my
connections in recvline as I don't want it to react on a per character basis
but rather a per line basis...

*confused of england*

Andrew


On 8/8/07, Jean-Paul Calderone < exarkun at divmod.com> wrote:
>
> On Wed, 8 Aug 2007 13:25:59 +0100, Andrew Roden < andrew.roden at gmail.com>
> wrote:
> >Hi
> >
> >I'm pretty new to python which probably isn't helping, but I'm kind of
> stuck
> >with twisted telnet. I'm trying to build a couple of 'emulators' for some
>
> >simple router/switches just so that you can log on and run some
> 'standard'
> >commands and get a 'standard' output for use elsewhere. I've managed to
> get
> >an SSH version working with the massively helpful section in the O'Reilly
>
> >book but I cannot get the telnet version working. the script 'runs' with
> no
> >errors, but it doesn't stay running and bind to port 23 giving me my
> telnet
> >server. I enclose a zip with the ssh and the telnet versions, if anyone
> can
> >give me any pointers it would be massively appreciated (I haven't even
> >attempted to add in the 'login' which is in the SSH version... so any
> help
> >on that would be great too :) )
>
> Are you using twistd to run it?
>
>     $ twistd -noy telnet_server.py
>     Removing stale pidfile twistd.pid
>     2007-08-08 08:31:05-0400 [-] Log opened.
>     2007-08-08 08:31:05-0400 [-] twistd 2.5.0+r20987 (/usr/bin/python
> 2.4.3) starting up
>     2007-08-08 08:31:05-0400 [-] reactor class: <class '
> twisted.internet.selectreactor.SelectReactor'>
>     2007-08-08 08:31:05-0400 [-] twisted.internet.protocol.ServerFactorystarting on 23
>     2007-08-08 08:31:05-0400 [-] Starting factory <
> twisted.internet.protocol.ServerFactory instance at 0xb77f5fac>
>     ...
>
> After I connect to the port, it reports several tracebacks and drops the
> connection.
>
> Jean-Paul
>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20070808/88eef26e/attachment.html>


More information about the Twisted-Python mailing list