471,310 Members | 1,430 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,310 software developers and data experts.

Need some help with my first Twisted program

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
Oct 19 '07 #1
1 1071
McCann, Brian wrote:
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

--
BOFH excuse #366:

ATM cell has no roaming feature turned on, notebooks can't connect

Oct 20 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Randall Smith | last post: by
2 posts views Thread by Taki Jeden | last post: by
3 posts views Thread by Y2KYZFR1 | last post: by
6 posts views Thread by Kartic | last post: by
1 post views Thread by sndive | last post: by
reply views Thread by huisan.wang | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.