Repository navigation
Conversation
connectionTimeout bounds the TCP connect and TLS handshake of TCP and secure TCP connections, but a websocket connection opened with WebSocket.connect had no bound at all, in connect and in connectAuto. A broker or network that accepts the connection but never answers the websocket upgrade (common when a mobile network comes back, or on a Wi-Fi without internet) held the attempt forever. During an auto reconnect that also held the auto reconnect itself: it never made another attempt, so the client stayed in the connecting state even after the network was back. connectionTimeout now also applies to the default websocket implementation: the TCP connect, the TLS handshake of a wss connection and the websocket upgrade, in connect and in connectAuto. When it elapses the attempt fails with a NoConnectionException through the existing failed connect path, and the auto reconnect moves on to its next attempt. A websocket that connects after the timeout is closed when it does and is never used. With connectionTimeout unset the behaviour is unchanged. The alternate websocket implementation is not covered. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
connectionTimeout bounds the TCP connect and TLS handshake of TCP and secure TCP connections, but a websocket connection opened with WebSocket.connect had no bound at all, in connect and in connectAuto. A broker or network that accepts the connection but never answers the websocket upgrade (common when a mobile network comes back, or on a Wi-Fi without internet) held the attempt forever. During an auto reconnect that also held the auto reconnect itself: it never made another attempt, so the client stayed in the connecting state even after the network was back.
connectionTimeout now also applies to the default websocket implementation: the TCP connect, the TLS handshake of a wss connection and the websocket upgrade, in connect and in connectAuto. When it elapses the attempt fails with a NoConnectionException through the existing failed connect path, and the auto reconnect moves on to its next attempt. A websocket that connects after the timeout is closed when it does and is never used.
With connectionTimeout unset the behaviour is unchanged. The alternate websocket implementation is not covered.