Closed p-i- closed 3 years ago
It isn't crashing. The remote server just doesn't like you or what you are doing to it, and is closing the connection.
2021-06-12 17:55:48,365 _impl.py:1221 _reader_task() client-0 received zero bytes (connection closed)
2021-06-12 17:55:48,366 _impl.py:1019 _close_web_socket() client-0 websocket closed ConnectionClosed<CloseReason<code=1006, name=ABNORMAL_CLOSURE, reason=None>>
My bad, I was failing to gzip-decompress the payload. Nothing to do with ping.
The following code sends a message upon connect. It listens for messages, while also sending a ping at regular intervals to keep the socket alive.
Adding the
keepalive
causes it to crash.Here's the crashdump:
Simply removing the
on_connect
message fixes:Note that
get_message
isn't picking up thepong
response.So somehow
send_message
andping
are interfering with one another.I thought it might be a timing issue, that both sends are happening at the same time. If that was the case this would resolve it:
But it doesn't.
Is this a known issue? Or a PEBCAK my end...