473,287 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 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 1143
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tlo | last post by:
hello, i would like to do the following, and as i had never used python in a network framework i would like to have opinions on this : i would like to provide some kind of network quizz game,...
2
by: Randall Smith | last post by:
When I had been programming for a few years, I realised that as much as a love to learn, I can only explore and be proficient at a limited subset of technologies. I explored different languages to...
2
by: Taki Jeden | last post by:
Hi Anybody used wxPython with twisted? I started putting together a Twisted-based app with wx GUI, and the widgets just don't work - some controls do not show up etc. - at least on my system....
3
by: Y2KYZFR1 | last post by:
need some help getting started, it is just a "little" confusing on where to actually start. I want to write a turn based board game using Twisted as the networking layer. I just need a kind of...
6
by: Kartic | last post by:
Hello, I downloaded the Win32 installer for Twisted 1.3.0, Python 2.3. The installer, when executed under my login, fails as it requires administrator rights to install (why they have it as a...
2
by: SeSe | last post by:
Hi, I am new to Twisted. I use a Twisted 1.3.0 on MS Windows XP Home Edition, my python version is 2.3 I try the TCP echoserv.py and echoclient.py example. But the client always fail with...
36
by: Cap'n Ahab | last post by:
I have used VB3 - VB6, so learning all this OO stuff is reasonably new to me (although I looked at Java a few years ago). Anyway, I thought I would write a small class to begin with, with a...
1
by: sndive | last post by:
i have a lot of trouble selling twisted a a client lib for network access (on embedded platform) the group i'm a member of wants to write some unmaintainable threaded blocking junk in c--. does...
0
by: huisan.wang | last post by:
Hello everyone, I am writing a program with twisted and dbus and got a such problem. If i run the code as $python local_proxy.py There is an error like this: Traceback (most recent call...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.