// Enumeration<NetworkInterface> enumeration = NetworkInterface.getNetworkInterfaces();
// NetworkInterface wlan0 = null;
// while (enumeration.hasMoreElements() {
// wlan0 = enumeration.nextElement()
// if (wlan0.getName().equals("wlan0")) {
// //there is probably a better way to find wlan0 interface
// break;
// }
// }
// groupSocket.joinGroup(Address, eth0);
正好碰到,可以指定wlan0上,但是这样还是不能发送消息。需要添加一条路由route add -net 224.0.0.0 netmask 224.0.0.0 dev wlan0不知道能不用用代码形式添加。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货