Ejemplo n.º 1
0
 async def asgi(receive, send):
     websocket = WebSocket(scope, receive=receive, send=send)
     await websocket.accept()
     async for data in websocket.iter_text():
         await websocket.send_text("Message was: " + data)
Ejemplo n.º 2
0
 async def app(scope: Scope, receive: Receive, send: Send) -> None:
     websocket = WebSocket(scope, receive=receive, send=send)
     await websocket.accept()
     async for data in websocket.iter_text():
         await websocket.send_text("Message was: " + data)
Ejemplo n.º 3
0
 async def _wait_client_disconnect(self, ws: WebSocket) -> None:
     async for _ in ws.iter_text():
         pass  # pragma: no cover