Closed sashker closed 3 years ago
This error means that your client doesn't respond to server ping frames. You need to fix your client library to do that.
Similar issue with php
https://github.com/Textalk/websocket-php/pull/87
if you provide information on your go library, we can take a look.
Yes, could be. )) Probably, the python client does that automatically...
I'm currently using github.com/sacOO7/gowebsocket
I'll double-check ping/pong's and reply back asap.
Thank you.
Ok, looking on this code I think you should manually send back pong message in onPingRecieved handler.
I've changed the library to https://godoc.org/nhooyr.io/websocket. This library automatically responses to ping and it does - I can see ping/pong in a Wireshark dump. But the server still does interrupt the session due to client's timeout. (the vanilla python client works well, though).
You can uncomment logging here:
and see what happened on the server side.
For those who use Golang - make sure that your library supports automatic/manual Pong, and make sure that your context does not cancel the client by timeout.
Hello.
Thank you for the amazing job you've done.
Currently, I do my tests on the docker container provided, with the Websocket server. I randomly receive errors from the server with the 1006 and 1011 codes. I use the same file with approx. 10 minutes length and send chunks of a wav-file from my custom go-client.
The exception on the server looks like this:
Traceback (most recent call last): File "/usr/lib/python3/dist-packages/websockets/protocol.py", line 684, in transfer_data yield from self._put_message_waiter concurrent.futures._base.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/lib/python3/dist-packages/websockets/server.py", line 169, in handler yield from self.ws_handler(self, path) File "./asr_server.py", line 74, in recognize await websocket.send(response) File "/usr/lib/python3/dist-packages/websockets/protocol.py", line 462, in send yield from self.ensure_open() File "/usr/lib/python3/dist-packages/websockets/protocol.py", line 658, in ensure_open ) from self.transfer_data_exc websockets.exceptions.ConnectionClosed: WebSocket connection is closed: code = 1006 (connection closed abnormally [internal]), no reason