import socket
import json
import sys
import pickle
from contextlib import closing


def check_socket(host, port):
    with closing(socket.socket()) as s:
        try:
            s.connect((host, port))
            print('Port is open')
            pickled = pickle.loads(s.recv(1024))
            print(pickled)
            jresp = json.loads(pickled)
            print(jresp)
        except ConnectionRefusedError:
            print('Port is not open')
        except:
            e = sys.exc_info()[0]
            print(e)


host = socket.gethostbyname(socket.gethostname())
port = 8080
check_socket(host, port)

2d81bdfe0aed5e45b71b73bd9c8de836eb0fa2a2
<mask token>


def check_socket(host, port):
    with closing(socket.socket()) as s:
        try:
            s.connect((host, port))
            print('Port is open')
            pickled = pickle.loads(s.recv(1024))
            print(pickled)
            jresp = json.loads(pickled)
            print(jresp)
        except ConnectionRefusedError:
            print('Port is not open')
        except:
            e = sys.exc_info()[0]
            print(e)


<mask token>

<mask token>


def check_socket(host, port):
    with closing(socket.socket()) as s:
        try:
            s.connect((host, port))
            print('Port is open')
            pickled = pickle.loads(s.recv(1024))
            print(pickled)
            jresp = json.loads(pickled)
            print(jresp)
        except ConnectionRefusedError:
            print('Port is not open')
        except:
            e = sys.exc_info()[0]
            print(e)


<mask token>
check_socket(host, port)

<mask token>


def check_socket(host, port):
    with closing(socket.socket()) as s:
        try:
            s.connect((host, port))
            print('Port is open')
            pickled = pickle.loads(s.recv(1024))
            print(pickled)
            jresp = json.loads(pickled)
            print(jresp)
        except ConnectionRefusedError:
            print('Port is not open')
        except:
            e = sys.exc_info()[0]
            print(e)


host = socket.gethostbyname(socket.gethostname())
port = 8080
check_socket(host, port)

import socket
import json
import sys
import pickle
from contextlib import closing


def check_socket(host, port):
    with closing(socket.socket()) as s:
        try:
            s.connect((host, port))
            print('Port is open')
            pickled = pickle.loads(s.recv(1024))
            print(pickled)
            jresp = json.loads(pickled)
            print(jresp)
        except ConnectionRefusedError:
            print('Port is not open')
        except:
            e = sys.exc_info()[0]
            print(e)


host = socket.gethostbyname(socket.gethostname())
port = 8080
check_socket(host, port)
