Island: Remove disused remote_port_check service

This commit is contained in:
Mike Salvatore 2022-04-21 14:24:34 -04:00
parent 53b405a115
commit 2ba94fde7d
1 changed files with 0 additions and 18 deletions

View File

@ -1,18 +0,0 @@
import socket
DEFAULT_TIMEOUT = 5 # Seconds
def check_tcp_port(ip: str, port: str, timeout=DEFAULT_TIMEOUT) -> bool:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(timeout)
try:
sock.connect((ip, int(port)))
except socket.timeout:
return False
except socket.error:
return False
finally:
sock.close()
return True