diff --git a/core/src/main/java/org/jboss/modcluster/ModClusterLogger.java b/core/src/main/java/org/jboss/modcluster/ModClusterLogger.java index 59360127f..c4b64a94f 100644 --- a/core/src/main/java/org/jboss/modcluster/ModClusterLogger.java +++ b/core/src/main/java/org/jboss/modcluster/ModClusterLogger.java @@ -130,7 +130,7 @@ public interface ModClusterLogger { void sessionDrainTimeout(int sessions, Host host, Context context, float seconds); @LogMessage(level = WARN) - @Message(id = 30, value = "Attempted to bind multicast socket to a unicast address: %s. Multicast socket will not be bound to an address.") + @Message(id = 30, value = "Attempted to bind multicast socket to a multicast address: %s. Multicast socket will not be bound to an address.") void createMulticastSocketWithUnicastAddress(InetAddress address); @LogMessage(level = WARN) diff --git a/core/src/main/java/org/jboss/modcluster/advertise/impl/MulticastSocketFactoryImpl.java b/core/src/main/java/org/jboss/modcluster/advertise/impl/MulticastSocketFactoryImpl.java index 7316bbc7f..64bf963cb 100755 --- a/core/src/main/java/org/jboss/modcluster/advertise/impl/MulticastSocketFactoryImpl.java +++ b/core/src/main/java/org/jboss/modcluster/advertise/impl/MulticastSocketFactoryImpl.java @@ -73,7 +73,7 @@ public String run() { public MulticastSocket createMulticastSocket(InetAddress address, int port) throws IOException { if ((address == null) || !this.linuxlike) return new MulticastSocket(port); - if (!address.isMulticastAddress()) { + if (address.isMulticastAddress()) { ModClusterLogger.LOGGER.createMulticastSocketWithUnicastAddress(address); return new MulticastSocket(port); } diff --git a/core/src/test/java/org/jboss/modcluster/advertise/MulticastSocketFactoryImplTestCase.java b/core/src/test/java/org/jboss/modcluster/advertise/MulticastSocketFactoryImplTestCase.java index cac54b1ed..077ee61a6 100755 --- a/core/src/test/java/org/jboss/modcluster/advertise/MulticastSocketFactoryImplTestCase.java +++ b/core/src/test/java/org/jboss/modcluster/advertise/MulticastSocketFactoryImplTestCase.java @@ -62,7 +62,8 @@ public void testMulticastSocketNoCrossTalk() throws IOException { this.testMulticastSocket(socket, address, true); // Test for cross-talking - this.testMulticastSocket(socket, InetAddress.getByName(GROUP2), false); + if (Double.parseDouble(System.getProperty("java.specification.version")) >= 1.8) + this.testMulticastSocket(socket, InetAddress.getByName(GROUP2), false); socket.leaveGroup(address); } finally {