8151444: JDP not working
Don't set IP_MULTICAST_IF explicitly Reviewed-by: sla, ysuenaga
This commit is contained in:
parent
635b3f6584
commit
260f238cd5
@ -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.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user