From: Christian Heller Date: Mon, 2 Nov 2020 01:47:12 +0000 (+0100) Subject: Allow remote connections into TCP server. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/static/%7B%7B%20web_path%20%7D%7D/templates?a=commitdiff_plain;h=72652ab5bc9917ecf49ef076e6a8eb8d3ca9a710;p=plomrogue2-experiments Allow remote connections into TCP server. --- diff --git a/new2/plomrogue/io_tcp.py b/new2/plomrogue/io_tcp.py index 5cf66d9..45bf447 100644 --- a/new2/plomrogue/io_tcp.py +++ b/new2/plomrogue/io_tcp.py @@ -158,7 +158,7 @@ class PlomTCPServer(socketserver.ThreadingTCPServer): """Bind together threaded IO handling server and message queue.""" def __init__(self, queue, port, *args, **kwargs): - super().__init__(('localhost', port), IO_Handler, *args, **kwargs) + super().__init__(('0.0.0.0', port), IO_Handler, *args, **kwargs) self.queue_out = queue self.daemon_threads = True # Else, server's threads have daemon=False. self.clients = {} diff --git a/new2/rogue_chat.py b/new2/rogue_chat.py index 832adcd..4294850 100755 --- a/new2/rogue_chat.py +++ b/new2/rogue_chat.py @@ -10,5 +10,5 @@ if len(sys.argv) != 2: savefile = sys.argv[1] game = Game(savefile) game.io.start_loop() -game.io.start_server(8000, PlomWebSocketServer) -#game.io.start_server(8001, PlomTCPServer) +game.io.start_server(8001, PlomWebSocketServer) +game.io.start_server(5000, PlomTCPServer)