From 04f03f4633f821d1799c1ff4904d4d12ba5b6f27 Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Tue, 7 Oct 2014 10:08:52 +0200 Subject: [PATCH 1/2] Fix for MODCLUSTER-432. --- core/src/main/java/org/jboss/modcluster/ModClusterLogger.java | 2 +- .../modcluster/advertise/impl/MulticastSocketFactoryImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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); } From 9d5d259af8b240574bdcf94909ee2d0215629286 Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Tue, 7 Oct 2014 11:10:43 +0200 Subject: [PATCH 2/2] Do the test only with java8 (otherwise it will fail). --- .../advertise/MulticastSocketFactoryImplTestCase.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 {