Okay, the following code below works:
package org.jgroups.tests;
import java.net.*;
/**
* @author Bela Ban
* @version $Id$
*/
public class bla
{
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);
SocketAddress saddr;
saddr=new InetSocketAddress(interfaceAddress, port);
MulticastSocket socket = new MulticastSocket(saddr);
socket.setInterface(interfaceAddress);
socket.setNetworkInterface(networkInterface);
socket.joinGroup(multicastAddress);
Thread.sleep(600000);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3958314#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...