1
0

add timeout

This commit is contained in:
2021-05-28 13:29:25 +02:00
parent 44edccd593
commit 2c0693821f

View File

@@ -48,6 +48,7 @@ def version_to_string(version):
def query_server(host, port=34197):
global info
s = socket.socket(type=socket.SOCK_DGRAM)
s.settimeout(5)
s.sendto(bytes.fromhex("30"), (host, port))
info = s.recvfrom(512)[0]