1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-28 03:08:14 +00:00

Update notification_handler.py

Force close websocket tcp socket.
This commit is contained in:
John Fleming 2024-02-20 00:46:00 -05:00 committed by GitHub
parent d94adf4c8f
commit 8a459a4821
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -82,6 +82,11 @@ class NotificationHandler:
log.info("Client has disconnected from controller WebSocket")
if not ws.closed:
await ws.close()
try:
# call close to force close ws transport. Unknown root cause as of yet.
ws._req.transport.close()
except:
pass
request.app['websockets'].discard(ws)
return ws