class Client:
    def __init__(self, host, server_port):
        self.host = host
        self.server_port = server_port
        self.connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.run()

    def run(self):
        self.connection.connect((self.host, self.server_port))
        self.messagereceiver = MessageReceiver(self, self.connection)
        self.messagereceiver.start()

    def disconnect(self):
        self.messagereceiver.is_running = False
        self.connection.close()
        pass

    def send_payload(self, data):
        self.connection.send(data.encode("UTF-8"))
        pass
 def run(self):
     self.connection.connect((self.host, self.server_port))
     self.messagereceiver = MessageReceiver(self, self.connection)
     self.messagereceiver.start()