mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Set TCP timeout to a more reasonable value
This commit is contained in:
parent
959b02f58f
commit
f10db73fa5
@ -90,6 +90,7 @@ class Helpers:
|
|||||||
try:
|
try:
|
||||||
host_public = get('https://api.ipify.org').text
|
host_public = get('https://api.ipify.org').text
|
||||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
|
sock.settimeout(10.0)
|
||||||
result = sock.connect_ex((host_public ,server_port))
|
result = sock.connect_ex((host_public ,server_port))
|
||||||
sock.close()
|
sock.close()
|
||||||
if result == 0:
|
if result == 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user