Need some help with my first Twisted program

M

McCann, Brian

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.serialServerSocket.close()
self.alive = False
self.serialSocketReadThread.join()

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

Thanks,
--Brian
 
B

Bjoern Schliessmann

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

Didn't you get an answer? The cracks for special topics are usually
there.
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.serialServerSocket.close()
self.alive = False
self.serialSocketReadThread.join()

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

No, since the definition of a never called function won't help.

Try the following standard strategy: Make a copy of your project and
reduce it (removing functionality) until the error doesn't appear
anymore. If it does *not* vanish, post your short code here or in
the Twisted list.

Regards & happy hunting,


Björn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top