I have a code about multicast sending and receiving. It can work on Mac using JDK 6. However, when I change to use JDK 7, it can't work correctly.
The code is like this:
final InetAddress group = InetAddress.getByName("220.127.116.11");
final MulticastSocket socket = new MulticastSocket(2012);
final int length = 8 * 1024;
final byte bytes = new byte[length];
final DatagramPacket packet = new DatagramPacket(bytes, length);
Using JDK 7 to compile and run it, it can't work when VMware running. But if using JDK 6, it can work even though VMware is running.
Besides, I try to use WireShark to monitor the adapter. And I found WireShark can see all multicast packets sent and received when using JDK 7 to run my program. But the multicast socket can't receive any.
Anyone has any idea about it? Thanks for your help.