frankie567 / httpx-ws

WebSocket support for HTTPX
https://frankie567.github.io/httpx-ws/
MIT License
110 stars 17 forks source link

Unhandled exception of pinging in closing state #43

Closed T-256 closed 1 year ago

T-256 commented 1 year ago
Task exception was never retrieved
future: <Task finished coro=<AsyncWebSocketSession._background_keepalive_ping() done, defined at E:\proj\.venv\lib\site-packages\httpx_ws\_api.py:951> exception=LocalProtocolError('Event Ping(payload=b"vaY\\xd4\'\\x13\\x81\\x9ft\\x9a \\x953.a\\xfb\\xc6,\\xcbj\\x8c\\xa6\\xf4s\\x17&\\x80\\x11\\xc5\\x87y\\xfd") cannot be sent in state ConnectionState.LOCAL_CLOSING.')>
Traceback (most recent call last):
  File "E:\proj\.venv\lib\site-packages\httpx_ws\_api.py", line 957, in _background_keepalive_ping
    pong_callback = await self.ping()
  File "E:\proj\.venv\lib\site-packages\httpx_ws\_api.py", line 611, in ping
    await self.send(event)
  File "E:\proj\.venv\lib\site-packages\httpx_ws\_api.py", line 637, in send
    data = self.connection.send(event)
  File "E:\proj\.venv\lib\site-packages\wsproto\connection.py", line 108, in send
    f"Event {event} cannot be sent in state {self.state}."
wsproto.utilities.LocalProtocolError: Event Ping(payload=b"vaY\xd4'\x13\x81\x9ft\x9a \x953.a\xfb\xc6,\xcbj\x8c\xa6\xf4s\x17&\x80\x11\xc5\x87y\xfd") cannot be sent in state ConnectionState.LOCAL_CLOSING.