Allow websocket server to reuse its port (handle crashes better)

This commit is contained in:
Danielle McLean 2024-07-23 10:45:06 +10:00
parent 1e6dffcdcc
commit e2268c0c34
Signed by: 00dani
GPG key ID: 6854781A0488421C

View file

@ -34,7 +34,7 @@ class WebsocketsReceiver(Receiver):
async def start(self, player: Player) -> None:
self.player = player
await serve(self.handle, host=self.config.host, port=self.config.port)
await serve(self.handle, host=self.config.host, port=self.config.port, reuse_port=True)
async def handle(self, conn: WebSocketServerProtocol) -> None:
self.connections.add(conn)