mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Option for auto close project when no client listen
And fix websocket not correctly detected has closed. Ref https://github.com/GNS3/gns3-gui/issues/1331
This commit is contained in:
4 files changed
+26
No files matched your search
@@ -32,11 +32,16 @@ class NotificationHandler:
|
||||
ws = WebSocketResponse()
|
||||
yield from ws.prepare(request)
|
||||
|
||||
# Process ping / pong and close message
|
||||
asyncio.async(ws.receive())
|
||||
|
||||
with notifications.queue() as queue:
|
||||
while True:
|
||||
try:
|
||||
notification = yield from queue.get_json(5)
|
||||
except asyncio.futures.CancelledError:
|
||||
break
|
||||
if ws.closed:
|
||||
break
|
||||
ws.send_str(notification)
|
||||
return ws
|
||||
Reference in new issue
Block a user