Ramesh-vani commited on
Commit
94a622b
·
1 Parent(s): 8a4d308

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -13,6 +13,7 @@ async def websocket_consumer(websocket, path):
13
  await wssocket.send(code)
14
  while True:
15
  response = await wssocket.recv()
 
16
  await websocket.send(response)
17
 
18
  except websockets.exceptions.ConnectionClosedOK:
@@ -27,7 +28,7 @@ class WebSocketThread(threading.Thread):
27
 
28
  # websocket_thread = WebSocketThread()
29
  # websocket_thread.start()
30
- asyncio.set_event_loop(asyncio.new_event_loop())
31
  start_server = websockets.serve(websocket_consumer, "0.0.0.0", 7860)
32
 
33
  asyncio.get_event_loop().run_until_complete(start_server)
 
13
  await wssocket.send(code)
14
  while True:
15
  response = await wssocket.recv()
16
+ print(response)
17
  await websocket.send(response)
18
 
19
  except websockets.exceptions.ConnectionClosedOK:
 
28
 
29
  # websocket_thread = WebSocketThread()
30
  # websocket_thread.start()
31
+ # asyncio.set_event_loop(asyncio.new_event_loop())
32
  start_server = websockets.serve(websocket_consumer, "0.0.0.0", 7860)
33
 
34
  asyncio.get_event_loop().run_until_complete(start_server)