class Server(): def __init__(self): self.socket = ServerSocket(port=9999) self.socket.bind() 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 client %s." % (e) return message
def __init__(self): self.socket = ServerSocket(port=9999) self.socket.bind()