socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: s.connect((HOST, int(22))) s.shutdown(2) code example
Example: socket hostname
socket.gethostbyname(socket.gethostname())
socket.gethostbyname(socket.gethostname())