Skip to content

Commit 2f5a8ba

Browse files
WillowSauceRWillowSauceR
authored andcommitted
fix WinError 10054 when scan some servers
1 parent 28c7223 commit 2f5a8ba

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

scan.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,9 @@ def sendPacket(startNum, count):
6969
payloads = []
7070
totalPlayerCount = 0
7171
while True:
72-
sk_rec = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
73-
sk_rec.bind((localHostIP, localHostPort))
7472
try:
75-
# if True:
73+
sk_rec = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
74+
sk_rec.bind((localHostIP, localHostPort))
7675
data, addr = sk_rec.recvfrom(10240)
7776
date = time.strftime('%H:%M:%S')
7877
if len(data) <= 30:

0 commit comments

Comments
 (0)