The modification aims to reestablish the connection whenever the WebSocketConnectionDelegate triggers the webSocketDidReceiveError event due to any POSIX error, except for ENOTCONN (code 57 - Socket is not connected).
Why is the change necessary?
After thorough monitoring, we observed that whenever the WebSocketConnectionDelegate triggers the webSocketDidReceiveError event due to any POSIX error other than ENOTCONN, the socket loses its connection. However, the WebSocketConnectionDelegate fails to call the webSocketDidDisconnect method, leaving the instance in a "connected" state, even though it is effectively disconnected. This situation prevents reconnection attempts, forcing users to restart the app to establish a new connection.
Description of the pull request
The modification aims to reestablish the connection whenever the
WebSocketConnectionDelegate
triggers thewebSocketDidReceiveError
event due to anyPOSIX
error, except forENOTCONN
(code57
-Socket is not connected
).Why is the change necessary?
After thorough monitoring, we observed that whenever the
WebSocketConnectionDelegate
triggers thewebSocketDidReceiveError
event due to anyPOSIX
error other thanENOTCONN
, the socket loses its connection. However, theWebSocketConnectionDelegate
fails to call thewebSocketDidDisconnect
method, leaving the instance in a "connected" state, even though it is effectively disconnected. This situation prevents reconnection attempts, forcing users to restart the app to establish a new connection.