This commit is contained in:
parent
791d0834b9
commit
dfa36b6294
|
@ -12,13 +12,13 @@ class WebSocketWrapper():
|
||||||
async def recv(self) -> str:
|
async def recv(self) -> str:
|
||||||
try:
|
try:
|
||||||
text = await self._websocket.receive_text()
|
text = await self._websocket.receive_text()
|
||||||
logger.info("Message received: {}", text)
|
logger.info("Message received: %s", text)
|
||||||
return text
|
return text
|
||||||
except WebSocketDisconnect as e:
|
except WebSocketDisconnect as e:
|
||||||
raise ConnectionClosed(e.code, 'WebSocketWrapper')
|
raise ConnectionClosed(e.code, 'WebSocketWrapper')
|
||||||
|
|
||||||
async def send(self, msg: str) -> None:
|
async def send(self, msg: str) -> None:
|
||||||
logger.info("Message sent: {}", msg)
|
logger.info("Message sent: %s", msg)
|
||||||
await self._websocket.send_text(msg)
|
await self._websocket.send_text(msg)
|
||||||
|
|
||||||
async def close(self, code: int, reason: str) -> None:
|
async def close(self, code: int, reason: str) -> None:
|
||||||
|
|
Loading…
Reference in a new issue