Add timeout to socket

This commit is contained in:
amcmanu3 2022-10-07 19:42:28 -04:00
parent f18b2bbc2f
commit 3ac77d05c7

View File

@ -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))