Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reconnection loops #44

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

alvaro-delacruz-bat
Copy link
Contributor

Description of the pull request

Enhanced the migrate connection code to resolve issues with NWConnection leaks. Additionally, implemented validation measures to avert the occurrence of reconnection loops.

Why is the change necessary?

Certain modifications have been implemented to address memory leaks during the execution of the migrateConnection function. However, the key alteration revolves around cases where the NWConnection instance on iOS is unexpectedly disposed of. In such instances, regardless of the number of reconnection attempts, they are destined to fail due to the connection's disposal. To counteract this situation, a safeguard has been introduced to detect entry into this reconnection loop. Consequently, the connection is deliberately dismantled, paving the way for the establishment of a fresh NWConnection instance, enabling subsequent reconnection attempts to succeed.

@benjamin-tang-pusher benjamin-tang-pusher self-assigned this Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants