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

feat(net): add Magicsock::network_change #1845

Merged
merged 4 commits into from
Nov 27, 2023
Merged

Conversation

dignifiedquire
Copy link
Contributor

This allows notifying iroh-net when the network has likely changed.

Usually this is only needed on android, as on all other OSes this is automatically detected.

This allows notifying `iroh-net` when the network has likely changed.

Usually this is only needed on android, as on all other OSes this is automatically detected.
Copy link
Contributor

@link2xt link2xt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with Android, switching between LTE and Wi-Fi works now on deltachat/deltachat-core-rust#5041

@link2xt
Copy link
Contributor

link2xt commented Nov 26, 2023

Is it fine to call this on non-Android platforms as well because it is debounced anyway? If both the iroh-using app and iroh detect network change, this would not result in double STUN request, right?

@dignifiedquire
Copy link
Contributor Author

Is it fine to call this on non-Android platforms as well because it is debounced anyway? If both the iroh-using app and iroh detect network change, this would not result in double STUN request, right?

It should be fine now, yes. The original version I had would not have been, but now that it is fed properly through the internal detector, feel free to call it unconditionally

iroh-net/src/magic_endpoint.rs Show resolved Hide resolved
@dignifiedquire dignifiedquire added this pull request to the merge queue Nov 27, 2023
Merged via the queue into main with commit 3952b04 Nov 27, 2023
@dignifiedquire dignifiedquire deleted the feat-android-network branch November 27, 2023 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants