Minor patch

This commit is contained in:
Miroslav Stampar 2015-11-17 01:38:43 +01:00
parent 89abeb0244
commit 5be0a83e94

View File

@ -1026,12 +1026,16 @@ def _setSocketPreConnect():
def _(): def _():
while kb.threadContinue: while kb.threadContinue:
for address in socket._ready: try:
if len(socket._ready[address]) < SOCKET_PRE_CONNECT_QUEUE_SIZE: for address in socket._ready:
s = socket.socket() if len(socket._ready[address]) < SOCKET_PRE_CONNECT_QUEUE_SIZE:
s._connect(address) s = socket.socket()
socket._ready[address].append(s._sock) s._connect(address)
time.sleep(0.01) socket._ready[address].append(s._sock)
except socket.error:
pass
finally:
time.sleep(0.01)
def connect(self, address): def connect(self, address):
found = False found = False