Correct position of the except clause in listener loop
This commit is contained in:
parent
acee18f0c4
commit
110dfc3324
|
@ -28,6 +28,9 @@ class Listener(threading.Thread):
|
|||
break
|
||||
try:
|
||||
conn, addr = self.s.accept()
|
||||
except socket.timeout:
|
||||
continue
|
||||
|
||||
logging.info('Incoming connection from: %s:%i', *addr[:2])
|
||||
with shared.connections_lock:
|
||||
if len(shared.connections) > shared.connection_limit:
|
||||
|
@ -36,5 +39,3 @@ class Listener(threading.Thread):
|
|||
c = Connection(*addr[:2], conn, server=True)
|
||||
c.start()
|
||||
shared.connections.add(c)
|
||||
except socket.timeout:
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue
Block a user