-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(iroh-net): allow the underlying UdpSockets to be rebound (#2946)
## Description In order to handle supsension and exits on mobile. we need to rebind our UDP sockets when they break. This PR adds the ability to rebind the socket on errors, and does so automatically on known suspension errors for iOS. When reviewing this, please specifically look at the duration of lock holding, as this is the most sensitive part in this code. Some references for these errors - libevent/libevent#1031 - #2939 ### TODOs - [x] code cleanup - [x] testing on actual ios apps, to see if this actually fixes the issues - [ ] potentially handle port still being in use? this needs some more thoughts Closes #2939 ## Breaking Changes The overall API for `netmon::UdpSocket` has changed entirely, everything else is the same. ## Notes & open questions - I have tried putting this logic higher in the stack, but unfortunately that did not work out. - We might not want to infinitely rebind a socket if the same error happens over and over again, unclear how to handle this. ## Change checklist - [ ] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented. --------- Co-authored-by: Philipp Krüger <[email protected]>
- Loading branch information
1 parent
4abfd61
commit cc9e4e6
Showing
8 changed files
with
953 additions
and
187 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.