Skip to content

Commit

Permalink
Minor patch
Browse files Browse the repository at this point in the history
  • Loading branch information
stamparm committed Nov 17, 2015
1 parent 89abeb0 commit 5be0a83
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/core/option.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,12 +1026,16 @@ def _setSocketPreConnect():

def _():
while kb.threadContinue:
for address in socket._ready:
if len(socket._ready[address]) < SOCKET_PRE_CONNECT_QUEUE_SIZE:
s = socket.socket()
s._connect(address)
socket._ready[address].append(s._sock)
time.sleep(0.01)
try:
for address in socket._ready:
if len(socket._ready[address]) < SOCKET_PRE_CONNECT_QUEUE_SIZE:
s = socket.socket()
s._connect(address)
socket._ready[address].append(s._sock)
except socket.error:
pass
finally:
time.sleep(0.01)

def connect(self, address):
found = False
Expand Down

0 comments on commit 5be0a83

Please sign in to comment.