Handling reconnect scenarios properly when socket is hung #1375
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.
In situations where the socket connection is lost via a
SO_ERROR
, even though reconnect is enabled, the socket manager hangs the socket until a manual disconnect. Symptom would be: the app would output something like the following:Socket-IO would be logging the retry requests over and over again with the following log:
In this case, the
active
socket is hung, so a retry would never be attempted. This condition can be simulated by running an app on a simulator while turning on Network Link Conditioner with 100% packet loss profile.This fix simply recycles the engine in the case that a
connecting
status has 1 or more retry attempts. This seems to resolve the issue.