mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 01:35:28 +01:00
Add timeout to socket
This commit is contained in:
parent
f18b2bbc2f
commit
3ac77d05c7
@ -136,6 +136,7 @@ def ping(ip, port):
|
||||
return i
|
||||
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
sock.settimeout(5)
|
||||
try:
|
||||
sock.connect((ip, port))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user