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
I'm investigating an issue where a linux client application using ix::WebSocket sometimes doesn't react to a websocket server (not IXWebSocket) closing its TCP socket. This is not a graceful websocket close handshake, but on TCP level a RST is being sent (according to WireShark) so the client is actually notified that the connection goes away.
Sometimes this results in the OnMessageCallback being called with a Close message with "abnormal closure" and sometimes it doesn't. When it doesn't, the next time any message is sent (either websocket ping or a regular message) it seems to realize the connection has failed and the OnMessageCallback is called with a Close message with "internal error".
My investigation so far has taken me to WebSocketTransport::poll: if _socket->isReadyToRead returns PollResultType::Error, it calls closeSocket, but the function will still return PollResult::Succeeded.
Won't that mean WebSocket::run will keep retrying poll on a closed socket? Is that intentional?
I experimented with adding return PollResult::AbnormalClose; after closeSocket in that if clause. It improved behavior in my case: I reliably get Close directly and with "abnormal closure".
Activity
engun commentedon Jun 26, 2023
me too
MichelJansson commentedon Nov 24, 2023
Same here, server is stopped but no Close event is received. @mduint32, have you found any downsides to your fix? Should we make a PR?