mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Add fix for port checker. We'll see if this works this time.
This commit is contained in:
parent
07d7c7ae60
commit
3ed304c378
@ -97,12 +97,16 @@ class Helpers:
|
||||
|
||||
@staticmethod
|
||||
def check_port(server_port):
|
||||
try:
|
||||
host_public = get('https://api.ipify.org').text
|
||||
tn = telnetlib.Telnet(host_public, server_port, 10)
|
||||
telnetlib.close()
|
||||
a_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
|
||||
ip = get('https://api.ipify.org').content.decode('utf8')
|
||||
|
||||
location = (ip, server_port)
|
||||
result_of_check = a_socket.connect_ex(location)
|
||||
|
||||
if result_of_check == 0:
|
||||
return True
|
||||
except Exception as err:
|
||||
else:
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
|
Loading…
Reference in New Issue
Block a user