MulticastSockets no longer get SO_REUSEADDR set prior to bind. As a result, if any existing process is already listening for multicast packets on the same port, MulticastSocket creation fails with a BindException: Address already in use.
Trivial test program (run 2 copies):
import java.net.*;
public class Mcast {
public static void main(String[] args) throws Exception {
DatagramSocket s = new MulticastSocket(4160);
synchronized (s) {
s.wait();
}
}
}
Trivial test program (run 2 copies):
import java.net.*;
public class Mcast {
public static void main(String[] args) throws Exception {
DatagramSocket s = new MulticastSocket(4160);
synchronized (s) {
s.wait();
}
}
}