Don't ignore disconnects when they happen during data transfer, instead properly disconnect the client

This commit is contained in:
Fabian Dill 2020-04-19 13:16:12 +02:00
parent 659bc0e177
commit 24fce94766
1 changed files with 1 additions and 4 deletions

View File

@ -99,10 +99,7 @@ class Context:
async def send_msgs(websocket, msgs):
if not websocket or not websocket.open or websocket.closed:
return
try:
await websocket.send(json.dumps(msgs))
except websockets.ConnectionClosed:
pass
await websocket.send(json.dumps(msgs))
def broadcast_all(ctx : Context, msgs):
for client in ctx.clients: