[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/detection/multicast ...

Tom Elrod tom.elrod at jboss.com
Mon Jul 17 01:16:20 EDT 2006


  User: telrod  
  Date: 06/07/17 01:16:19

  Modified:    src/main/org/jboss/remoting/detection/multicast 
                        MulticastDetector.java
  Log:
  JBREM-545 - fixed binding of the MultiplexSocket within MultiplexDetector to actually bind to the address specified.
  
  Revision  Changes    Path
  1.9       +5 -6      JBossRemoting/src/main/org/jboss/remoting/detection/multicast/MulticastDetector.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MulticastDetector.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/detection/multicast/MulticastDetector.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- MulticastDetector.java	3 Jul 2006 18:55:32 -0000	1.8
  +++ MulticastDetector.java	17 Jul 2006 05:16:19 -0000	1.9
  @@ -31,7 +31,9 @@
   import java.io.ObjectOutputStream;
   import java.net.DatagramPacket;
   import java.net.InetAddress;
  +import java.net.InetSocketAddress;
   import java.net.MulticastSocket;
  +import java.net.SocketAddress;
   
   /**
    * MulticastDetector is a remoting detector that broadcasts detection messages using
  @@ -40,7 +42,7 @@
    * @author <a href="mailto:jhaynie at vocalocity.net">Jeff Haynie</a>
    * @author <a href="mailto:adrian.brock at happeningtimes.com">Adrian Brock</a>
    * @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</a>
  - * @version $Revision: 1.8 $
  + * @version $Revision: 1.9 $
    */
   public class MulticastDetector extends AbstractDetector implements MulticastDetectorMBean
   {
  @@ -149,11 +151,8 @@
            // use this to bind so multicast will work w/o network
            this.bindAddr = localHost;
         }
  -      socket = new MulticastSocket(port);
  -      if(bindAddr != null)
  -      {
  -         socket.setInterface(bindAddr);
  -      }
  +      SocketAddress saddr = new InetSocketAddress(bindAddr, port);
  +      socket = new MulticastSocket(saddr);
         socket.joinGroup(addr);
   
         super.start();
  
  
  



More information about the jboss-cvs-commits mailing list