Non-blocking DatagramSocket?

I am currently developing an Android client application that needs to do non-blocking packet reception over UDP. Is there a way to set the DatagramSocket so that it doesn't block when receiving () it?

Basically, I am asking how to set the MSG_DONTWAIT flag for a DatagramSocket.

+3


source to share


1 answer


What you are looking for is java.nio.channels.DatagramChannel

friends.



+3


source







All Articles