Java Multicast Sending Data, Not Receiving

ぐ巨炮叔叔 提交于 2019-12-01 17:25:33

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!