According to this post, UDP just doesn't block. Are there any advantage using the (non-blocking) NIO API for UDP? Or should I just use the easier "traditional" io API?
Asked
Active
Viewed 1,683 times
2 Answers
2
At the risk of just pointing you back, the comments to that post explain that UDP doesn't block on the TCP ACK, but you could still block on a kernel buffer overflow. This would happen only if you have a very big UDP burst.

MSalters
- 173,980
- 10
- 155
- 350
-
5Obviously nothing, that is exactly why you don't wait for TCP ACK. – MSalters Nov 13 '09 at 09:14
0
If you are working with a large number of streams, it may help you to have a dedicate threading model to handle those sockets. NIO provides some of the work (selectors) that would help.

Jim Rush
- 4,143
- 3
- 25
- 27
-
can NIO be used to listen to UDP broadcast from a server to an android phone. Is there any problem if i constantly receive and listen to UDP signals using the traditional way in android, because in my case after working for long time its not listening to packets. – George Thomas Sep 02 '16 at 04:27
-
I haven't, but this post (read all responses) indicates it can be: http://stackoverflow.com/questions/17472781/java-nio-udp-broadcast – Jim Rush Sep 02 '16 at 16:34