Need some help with my first Twisted program

McCann, Brian bmccann at
Fri Oct 19 22:21:37 CEST 2007

I posted this to the Twisted list...figured I'd try here too.

I'm looking for what is probably an simple solution I can't figure out
on my own.  I'm writing an SSH server based on the example on the web
(using conch).  I'm trying to figure out how to detect when the client
exists (for example, when I just close out PuTTY), but I can't get this
to work right.  Looking through the API docs I found "connectionLost()",
which I put in my protocol class (EchoProtocol in the example), but it's
never getting called.  Here's my connectionLost def:

    def connectionLost(self,reason):
        print "lost:%s" %reason
        self.alive = False

Can someone please tell me what I'm doing wrong?


More information about the Python-list mailing list