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

Prefer wifi network when connecting over udp #109

Merged
merged 1 commit into from
Dec 29, 2019

Conversation

Nisse43
Copy link
Contributor

@Nisse43 Nisse43 commented Aug 7, 2019

This works for android M 26 and above

This fixes issue #81

if ( networkInfo.getType() == ConnectivityManager.TYPE_WIFI ) {
cm.bindProcessToNetwork( net );
}
break;
Copy link
Contributor

Choose a reason for hiding this comment

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

The break should be inside the if statement, otherwise only the first network is evaluated, which might be the mobile network.
With that change it works perfectly for me!

@Nisse43
Copy link
Contributor Author

Nisse43 commented Aug 22, 2019 via email

This works for android 6 and above
@Nisse43
Copy link
Contributor Author

Nisse43 commented Aug 22, 2019

Fixed the issue above and extracted a method to make the code a bit easier to understand

@Nisse43
Copy link
Contributor Author

Nisse43 commented Nov 13, 2019

@voroshkov Do you want me to change anything still or expand the prefering of WIFI to TCP also?

@voroshkov
Copy link
Owner

@Nisse43, oops, sorry, lost a sense of time after the flying season. Will take a look at PRs soon. Thanks for reminding!

@voroshkov voroshkov changed the base branch from master to dev December 29, 2019 10:11
@voroshkov voroshkov merged commit d8abb07 into voroshkov:dev Dec 29, 2019
@Nisse43 Nisse43 deleted the fix-issue-81 branch January 29, 2020 21:31
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