class Server(object): def __init__(self): self.web_server = HTTPServerController() self.web_socket = WebSocketController() def start(self, quiet=False): self.web_server.start() self.web_socket.start(self.web_server.http_port + 1) def stop(self): self.web_socket.stop() self.web_server.stop() def send_message(self, msg): self.web_socket.send_async(msg) @property def http_port(self): return self.web_server.http_port
def __init__(self): self.web_server = HTTPServerController() self.web_socket = WebSocketController()