class Client(): def __init__(self): self.socket = ClientSocket() self.socket.connect() def encode(self, message): message = dumps(message, 2) return message def decode(self, message): try: message = loads(message) except Exception, e: message = None print "[X] Error decoding the message from the server %s." % (e) return message
def __init__(self): self.socket = ClientSocket() self.socket.connect()