Does Java NIO support broadcast or multicast?
问题 I am searching if Java NIO implements broadcast. I need to create a peer that sends messages to other peers, using multicast or broadcast. I was searching in the API 1.6, but I don't find anything in the DatagramChannel class. Thanks in advance. 回答1: NIO2 supports multicast, that's in Java 7. http://javanio.info/filearea/nioserver/WhatsNewNIO2.pdf 回答2: Before NIO2 you have to make use of all kinds of hacks to make a datagram channel join a multicast group. Not sure how they could have left