Don't bother waiting for messages if we already have one in queue.

This commit is contained in:
Shiz 2014-01-30 02:55:09 +01:00
parent 6a3b63a825
commit db2b883a6d
1 changed files with 3 additions and 0 deletions

View File

@ -436,6 +436,9 @@ class ConnectionPool:
sockets = { conn.socket: conn for conn in self.connections if conn.connected }
found = False
if self.has_message():
return
while not found:
# Wait forever until a socket becomes readable.
readable, writable, error = select.select(sockets.keys(), [], [])