Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5be0a83

Browse files
committed
Minor patch
1 parent 89abeb0 commit 5be0a83

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

lib/core/option.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,12 +1026,16 @@ def _setSocketPreConnect():
10261026

10271027
def _():
10281028
while kb.threadContinue:
1029-
for address in socket._ready:
1030-
if len(socket._ready[address]) < SOCKET_PRE_CONNECT_QUEUE_SIZE:
1031-
s = socket.socket()
1032-
s._connect(address)
1033-
socket._ready[address].append(s._sock)
1034-
time.sleep(0.01)
1029+
try:
1030+
for address in socket._ready:
1031+
if len(socket._ready[address]) < SOCKET_PRE_CONNECT_QUEUE_SIZE:
1032+
s = socket.socket()
1033+
s._connect(address)
1034+
socket._ready[address].append(s._sock)
1035+
except socket.error:
1036+
pass
1037+
finally:
1038+
time.sleep(0.01)
10351039

10361040
def connect(self, address):
10371041
found = False

0 commit comments

Comments
 (0)