You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a websocket datalink client sends a command that results in an error, a ERROR datalink packet is sent back with a reason, which is helpful. But the ringserver also closes the connection without going through the websocket close handshake, ie sending a CLOSE frame and waiting for the corresponding CLOSE response.
In clients.c about line 404 there is code to close the regular socket:
/* Close client socket */
if (cinfo->socket)
{
shutdown (cinfo->socket, SHUT_RDWR);
close (cinfo->socket);
cinfo->socket = 0;
}
but as far as I can see no corresponding code to close a websocket nicely. It would be nice if the websocket could be closed gracefully even in the case of errors.
This also occurs on when ringserver does an idle close.
ringserver logs:
Wed Aug 14 12:49:11 2024 - Closing idle client connection: localhost
Wed Aug 14 12:49:11 2024 - Client disconnected: localhost
but my python websocket client shows exception:
File "/Users/crotwell/Code/seis/simpledali/src/simpledali/websocketdali.py", line 67, in parseResponse
response = await self.ws.recv()
File "/opt/homebrew/Caskroom/miniforge/base/envs/simpledali_dev/lib/python3.10/site-packages/websockets/legacy/protocol.py", line 568, in recv
await self.ensure_open()
File "/opt/homebrew/Caskroom/miniforge/base/envs/simpledali_dev/lib/python3.10/site-packages/websockets/legacy/protocol.py", line 939, in ensure_open
raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: no close frame received or sent
If a websocket datalink client sends a command that results in an error, a ERROR datalink packet is sent back with a reason, which is helpful. But the ringserver also closes the connection without going through the websocket close handshake, ie sending a CLOSE frame and waiting for the corresponding CLOSE response.
In clients.c about line 404 there is code to close the regular socket:
but as far as I can see no corresponding code to close a websocket nicely. It would be nice if the websocket could be closed gracefully even in the case of errors.
Docs on CLOSE are here:
https://www.rfc-editor.org/rfc/rfc6455#section-5.5.1
The text was updated successfully, but these errors were encountered: