kumistatus/porttools/__init__.py
2016-03-30 18:15:30 +02:00

10 lines
195 B
Python

import socket
def isPortOpen(host, port):
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(1)
sock.connect((host, port))
except:
return False
return True