mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
2 files changed
+26
-5
No files matched your search
@@ -17,6 +17,7 @@
|
||||
|
||||
import os
|
||||
import aiohttp
|
||||
import aiohttp.errors
|
||||
import asyncio
|
||||
import tempfile
|
||||
|
||||
@@ -39,6 +40,17 @@ import logging
|
||||
log = logging.getLogger()
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
def process_websocket(ws):
|
||||
"""
|
||||
Process ping / pong and close message
|
||||
"""
|
||||
try:
|
||||
yield from ws.receive()
|
||||
except aiohttp.errors.WSServerHandshakeError:
|
||||
pass
|
||||
|
||||
|
||||
class ProjectHandler:
|
||||
|
||||
@Route.post(
|
||||
@@ -238,8 +250,7 @@ class ProjectHandler:
|
||||
ws = aiohttp.web.WebSocketResponse()
|
||||
yield from ws.prepare(request)
|
||||
|
||||
# Process ping / pong and close message
|
||||
asyncio.async(ws.receive())
|
||||
asyncio.async(process_websocket(ws))
|
||||
|
||||
with controller.notification.queue(project) as queue:
|
||||
while True:
|
||||
|
||||
Reference in new issue
Block a user