Changed socket port and added timeout (#2176)
This commit is contained in:
1 parent
c9bda112ae
commit
a5d5f9262d
1 file changed
+1
-1
+1
-1
@@ -51,7 +51,7 @@ def check_online():
|
|||||||
# Check internet connectivity
|
# Check internet connectivity
|
||||||
import socket
|
import socket
|
||||||
try:
|
try:
|
||||||
socket.create_connection(("1.1.1.1", 53)) # check host accesability
|
socket.create_connection(("1.1.1.1", 443), 5) # check host accesability
|
||||||
return True
|
return True
|
||||||
except OSError:
|
except OSError:
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in new issue
Block a user