Permalink
Browse files

Better handling of interrupt syscall

Happens regularly when suspending/resuming, but has no real effect on
the socket.

Signed-off-by: Jack Miller <jack@codezen.org>
  • Loading branch information...
1 parent d1d873c commit 0d566ebc2da8cda236e40357aecd16a834df0f0c @themoken committed Oct 18, 2012
Showing with 7 additions and 7 deletions.
  1. +7 −7 canto_next/server.py
View
@@ -50,20 +50,20 @@ def queue_loop(self, conn):
# Sit and select for connections on sockets:
def conn_loop(self, sockets):
- try:
- while self.alive:
+ while self.alive:
+ try:
r, w, x = select.select(sockets, [], sockets)
for s in sockets:
# If socket is readable, it's got a pending connection.
if s in r:
conn = s.accept()
log.info("conn %s from sock %s" % (conn, s))
self.queue.put((conn[0], ("NEWCONN","")))
- except Exception as e:
- tb = traceback.format_exc()
- log.error("Connection monitor thread dead on exception:")
- log.error("\n" + "".join(tb))
- return
+ except Exception as e:
+ tb = traceback.format_exc()
+ log.error("Connection monitor exception:")
+ log.error("\n" + "".join(tb))
+ log.error("Attempting to continue.")
def start_conn_loop(self):
self.conn_thread = Thread(target = self.conn_loop,

0 comments on commit 0d566eb

Please sign in to comment.