8151444: JDP not working

Don't set IP_MULTICAST_IF explicitly

Reviewed-by: sla, ysuenaga
This commit is contained in:
Dmitry Samersoff 2016-03-23 21:40:20 +03:00
parent 635b3f6584
commit 260f238cd5
3 changed files with 1 additions and 25 deletions

View File

@ -99,30 +99,7 @@ public final class JdpBroadcaster {
throw new JdpException("Unable to bind to source address");
}
channel.setOption(StandardSocketOptions.IP_MULTICAST_IF, interf);
} else {
Enumeration<NetworkInterface> nics = NetworkInterface.getNetworkInterfaces();
boolean succeed = false;
while (nics.hasMoreElements()) {
NetworkInterface nic = nics.nextElement();
if (nic.isUp() && nic.supportsMulticast()) {
try {
channel.setOption(StandardSocketOptions.IP_MULTICAST_IF, nic);
succeed = true;
} catch (IOException ex) {
// pass
}
}
}
if (!succeed) {
throw new JdpException("Unable to bind to any interfaces.");
}
}
}
/**

View File

@ -57,7 +57,6 @@ public class JdpDefaultsTest extends DynamicLauncher {
"-Dcom.sun.management.jmxremote.autodiscovery=true",
"-Dcom.sun.management.jdp.pause=1",
"-Dcom.sun.management.jdp.name=" + jdpName,
"-Dcom.sun.management.jdp.address=224.0.23.178",
"-Djava.util.logging.SimpleFormatter.format='%1$tF %1$tT %4$-7s %5$s %n'",
testName
};

View File

@ -122,7 +122,7 @@ public abstract class JdpTestCase {
*/
private void jdpPacketReceived(Map<String, String> payload) throws Exception {
final String instanceName = payload.get("INSTANCE_NAME");
if (instanceName.equals(connection.instanceName)) {
if (instanceName != null && instanceName.equals(connection.instanceName)) {
packetFromThisVMReceived(payload);
} else {
packetFromOtherVMReceived(payload);