activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r979324 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/discovery/multicast/MulticastDiscoveryAgent.java
Date Mon, 26 Jul 2010 15:24:11 GMT
Author: gtully
Date: Mon Jul 26 15:24:11 2010
New Revision: 979324

URL: http://svn.apache.org/viewvc?rev=979324&view=rev
Log:
resolve: https://issues.apache.org/activemq/browse/AMQ-2842 - patch applied with thanks

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/discovery/multicast/MulticastDiscoveryAgent.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/discovery/multicast/MulticastDiscoveryAgent.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/discovery/multicast/MulticastDiscoveryAgent.java?rev=979324&r1=979323&r2=979324&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/discovery/multicast/MulticastDiscoveryAgent.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/discovery/multicast/MulticastDiscoveryAgent.java
Mon Jul 26 15:24:11 2010
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.activemq.transport.discovery.multicast;
 
 import java.io.IOException;
@@ -83,6 +84,7 @@ public class MulticastDiscoveryAgent imp
     private long keepAliveInterval = DEFAULT_IDLE_TIME;
     private String mcInterface;
     private String mcNetworkInterface;
+    private String mcJoinNetworkInterface;
     private long lastAdvertizeTime;
     private AtomicBoolean started = new AtomicBoolean(false);
     private boolean reportAdvertizeFailed = true;
@@ -259,6 +261,10 @@ public class MulticastDiscoveryAgent imp
         this.mcNetworkInterface = mcNetworkInterface;    
     }
     
+    public void setJoinNetworkInterface(String mcJoinNetwrokInterface) {
+    	this.mcJoinNetworkInterface = mcJoinNetwrokInterface;
+    }
+    
     /**
      * start the discovery agent
      * 
@@ -299,6 +305,7 @@ public class MulticastDiscoveryAgent imp
         	  	LOG.trace("start - group  = " + group );		       	  	
         	  	LOG.trace("start - interface  = " + mcInterface );
         	  	LOG.trace("start - network interface  = " + mcNetworkInterface );
+        	  	LOG.trace("start - join network interface  = " + mcJoinNetworkInterface );
         	  }	
         	  
             this.inetAddress = InetAddress.getByName(myHost);
@@ -306,7 +313,12 @@ public class MulticastDiscoveryAgent imp
             mcast = new MulticastSocket(myPort);
             mcast.setLoopbackMode(loopBackMode);
             mcast.setTimeToLive(getTimeToLive());
-            mcast.joinGroup(inetAddress);
+            if (mcJoinNetworkInterface != null) {
+                mcast.joinGroup(sockAddress, NetworkInterface.getByName(mcJoinNetworkInterface));
+            }
+            else {
+            	mcast.joinGroup(inetAddress);
+            }
             mcast.setSoTimeout((int)keepAliveInterval);
             if (mcInterface != null) {
                 mcast.setInterface(InetAddress.getByName(mcInterface));



Mime
View raw message