asyncore.dispatcher stops listening

Discussion in 'Python' started by Daniel Walton, Sep 5, 2006.

  1. 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):
    self.log("accept")
    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 "./link_server.py", line 975, in ?
    main(sys.argv)
    File "./link_server.py", line 973, in main
    asyncore.loop()
    File "/usr/local/lib/python2.4/asyncore.py", line 192, in loop
    poll_fun(timeout, map)
    File "/usr/local/lib/python2.4/asyncore.py", line 122, in poll
    r, w, e = select.select(r, w, e, timeout)
    KeyboardInterrupt

    The only other detail that might be interesting is that I am starting
    the server with a
    nohup some_server.py > 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.
    dan
     
    Daniel Walton, Sep 5, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Maciek Zywno
    Replies:
    0
    Views:
    872
    Maciek Zywno
    Sep 3, 2003
  2. Tony Murphy
    Replies:
    0
    Views:
    1,545
    Tony Murphy
    Feb 16, 2004
  3. Marco Lorenzini
    Replies:
    0
    Views:
    398
    Marco Lorenzini
    May 13, 2004
  4. Indy
    Replies:
    2
    Views:
    274
  5. Dun Peal
    Replies:
    2
    Views:
    554
    Dun Peal
    Apr 20, 2011
Loading...

Share This Page