By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,262 Members | 1,125 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,262 IT Pros & Developers. It's quick & easy.

asyncore.dispatcher stops listening

P: n/a
I have been working on a problem for a full week now. If someone
could please help me it would be great. Even a clue would be great at
this point. What I am seeing is quite a mystery.

I have server written in python using asyncore.dispatcher. It listens
on port 9940 and does something like this on handle_accept

def handle_accept (self):
conn, addr = self.accept()
self.handlers += [asynchat.async_chat_subclass(conn,addr)]

I launch the server and test the server. Everything looks great aside
from a few functions that are a bit slow.

The server goes into use and receives some traffic for about 3 days
and then it stops listening. telneting to the port times out.
clients (8 or so) that are connected time out. The process is still
running. Its not taking lots of CPU or memory. I can start a new
server on the port without being told that something else is using it.

When I send the server a kill -SIGINT I get this call stack in the log
Traceback (most recent call last):
File "./", line 975, in ?
File "./", line 973, in main
File "/usr/local/lib/python2.4/", line 192, in loop
poll_fun(timeout, map)
File "/usr/local/lib/python2.4/", line 122, in poll
r, w, e =, w, e, timeout)

The only other detail that might be interesting is that I am starting
the server with a
nohup log &

What would cause a socket to quit listening? Any clue,
ideas,techniques, or experiences at all would be really helpful.

Thank you all very very much.
Sep 5 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.