I'm currently developing a client application for Android that is supposed to do non-blocking reception of packets through UDP. Is there any way to setup a DatagramSocket so that it is non-blocking on its receive()?
Basically what I'm asking is how to set the MSG_DONTWAIT flag for a DatagramSocket.
What you are looking for is java.nio.channels.DatagramChannel and friends.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With