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

setBroadcast(true) not working on Android #96

Closed
Rapsssito opened this issue Oct 17, 2019 · 8 comments
Closed

setBroadcast(true) not working on Android #96

Rapsssito opened this issue Oct 17, 2019 · 8 comments

Comments

@Rapsssito
Copy link
Collaborator

When calling socket.setBroadcast(true) on Android after binding the socket, it makes whole the process hang forever. This method works on iOS.

@Rapsssito Rapsssito changed the title setBroadcast(true); not working on Android setBroadcast(true) not working on Android Oct 17, 2019
@luobao1207
Copy link

I have the same problem.

@luobao1207
Copy link

@Rapsssito Have you solved it?

@Rapsssito
Copy link
Collaborator Author

Sadly, no.

@luobao1207
Copy link

@Rapsssito
I've been working all day, but I still haven't solved the problemwe. we need author's help.
If you solve it, please let me know.thanks

@Rapsssito
Copy link
Collaborator Author

I think it is related to the Android part. It looks like the process hangs on setting the socket broadcast to true.

@Rapsssito
Copy link
Collaborator Author

There could be useful info in #82 and @shynst's commit in his fork: shynst@aef3f01.

@thibmaek
Copy link
Contributor

I'm indeed seeing the hanging behaviour here. It even results in an error in a flow where you:

  1. create a udpv4 socket
  2. bind it
  3. set broadcasting
  4. call socket.close

That will throw an error Socket is closed from inside the setBroadcast method because it is still hanging.

Anyway, I've found that I can just omit the call to setBroadcast completely for Android. It nog longer produces the error or hangs the call (duh), but is still able to use UDP broadcasting just fine without it (Android 8, 9 and 10)

@Rapsssito
Copy link
Collaborator Author

Duplicate of #82, moving discussion over that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants