[jboss-user] [Remoting] - Re: binding multicast detector

tom.elrod@jboss.com do-not-reply at jboss.com
Sat Jul 15 14:12:25 EDT 2006


Here is a small test class showing the behavior.


  | public class MulticastSocketTest
  | {
  |    public static void main(String[] args)
  |    {
  |       try
  |       {
  |          int port = Integer.parseInt(args[0]);
  |          InetAddress interfaceAddress = InetAddress.getByName(args[1]);
  |          NetworkInterface networkInterface = NetworkInterface.getByInetAddress(interfaceAddress);
  |          InetAddress multicastAddress = InetAddress.getByName(args[2]);
  |          System.out.println("port = " + port + "\ninterface address = " + interfaceAddress +
  |                             "\nnetwork interface = " + networkInterface + "\nmulticast address = " + multicastAddress);
  |          MulticastSocket socket = new MulticastSocket(port);
  |          socket.setInterface(interfaceAddress);
  |          socket.setNetworkInterface(networkInterface);
  |          socket.joinGroup(multicastAddress);
  | 
  |          Thread.currentThread().sleep(60000);
  |       }
  |       catch (Exception e)
  |       {
  |          e.printStackTrace();
  |       }
  |    }
  | }
  | 

When I run this and pass the following arguments:

4900 192.168.1.100 224.1.9.1

I see the following doing 'netstat -n -a':

  UDP    0.0.0.0:4900           *:*



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3958284#3958284

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3958284



More information about the jboss-user mailing list