I am writing a class in Java which is used to greatly simplify the process of multicasting. However, I am having two big problems with it:
I've run into similar problems before and had to ensure that the NetworkInterface was specified on the receiving side.
SocketAddress socketAddress = new SocketAddress(groupIp, groupPort);
NetworkInterface networkInterface = NetworkInterface.getByName(interfaceName);
socket.joinGroup(socketAddress, networkInterface);
Where interfaceName
is one of the interface names shown when running ifconfig
on Linux or Mac.