From 71ece4e31c047d1a2087eeb7500280b30b086386 Mon Sep 17 00:00:00 2001 From: kimchy Date: Thu, 27 May 2010 13:12:33 +0300 Subject: [PATCH] rever back all interfaces binding in multicast --- .../zen/ping/multicast/MulticastZenPing.java | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/discovery/zen/ping/multicast/MulticastZenPing.java b/modules/elasticsearch/src/main/java/org/elasticsearch/discovery/zen/ping/multicast/MulticastZenPing.java index 6516d7bc17c..566694d75a8 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/discovery/zen/ping/multicast/MulticastZenPing.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/discovery/zen/ping/multicast/MulticastZenPing.java @@ -34,11 +34,13 @@ import org.elasticsearch.util.TimeValue; import org.elasticsearch.util.component.AbstractLifecycleComponent; import org.elasticsearch.util.io.stream.*; import org.elasticsearch.util.network.NetworkService; -import org.elasticsearch.util.network.NetworkUtils; import org.elasticsearch.util.settings.Settings; import java.io.IOException; -import java.net.*; +import java.net.DatagramPacket; +import java.net.InetAddress; +import java.net.MulticastSocket; +import java.net.SocketTimeoutException; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -135,16 +137,16 @@ public class MulticastZenPing extends AbstractLifecycleComponent implem try { MulticastSocket multicastSocket; - if (NetworkUtils.canBindToMcastAddress()) { - try { - multicastSocket = new MulticastSocket(new InetSocketAddress(group, port)); - } catch (Exception e) { - logger.debug("Failed to create multicast socket by binding to group address, binding to port", e); - multicastSocket = new MulticastSocket(port); - } - } else { - multicastSocket = new MulticastSocket(port); - } +// if (NetworkUtils.canBindToMcastAddress()) { +// try { +// multicastSocket = new MulticastSocket(new InetSocketAddress(group, port)); +// } catch (Exception e) { +// logger.debug("Failed to create multicast socket by binding to group address, binding to port", e); +// multicastSocket = new MulticastSocket(port); +// } +// } else { + multicastSocket = new MulticastSocket(port); +// } multicastSocket.setTimeToLive(ttl);