CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation

com.tangosol.net
Class MulticastTest

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.net.MulticastTest

public class MulticastTest
extends Base

Test multicast broadcast.

Author:
cp 2002.09.30

Nested Class Summary
 class MulticastTest.Listener
           
 
Field Summary
static String COMMAND_ADDR_GROUP
           
static String COMMAND_ADDR_LOCAL
           
static String COMMAND_DELAY
           
static String COMMAND_DISPLAY
           
static String COMMAND_HELP
           
static String COMMAND_TRANSLATE
           
static String COMMAND_TTL
           
static String DEFAULT_ADDR_GROUP
           
static String DEFAULT_ADDR_LOCAL
           
static int DEFAULT_DELAY
           
static int DEFAULT_DISPLAY
           
static String DEFAULT_IP_GROUP
           
static int DEFAULT_PORT
           
static int DEFAULT_TTL
           
static String[] VALID_COMMANDS
           
 
Constructor Summary
MulticastTest(InetAddress addrIface, InetSocketAddress addrGroup, int nTTL, int cSecsDelay, int cbMax, boolean fTranslate)
          Construct the MulticastTest object.
 
Method Summary
 void displayPacket(ReadBuffer buf, InetSocketAddress addr)
           
protected  void initSocket()
          Open the multicast socket.
static void main(String[] asArg)
          Parse and validate the command-line parameters and start the test.
 void run()
          Run the test.
protected static void showInstructions()
          Display the command-line instructions.
protected static InetAddress translateAddress(String sAddr)
          Convert an address string to an InetAddress.
protected static InetSocketAddress translateSocketAddress(String sAddr)
          Convert an address:port string to an InetSocketAddress.
 

Field Detail

COMMAND_HELP

public static final String COMMAND_HELP
See Also:
Constant Field Values

COMMAND_ADDR_LOCAL

public static final String COMMAND_ADDR_LOCAL
See Also:
Constant Field Values

COMMAND_ADDR_GROUP

public static final String COMMAND_ADDR_GROUP
See Also:
Constant Field Values

COMMAND_TTL

public static final String COMMAND_TTL
See Also:
Constant Field Values

COMMAND_DELAY

public static final String COMMAND_DELAY
See Also:
Constant Field Values

COMMAND_DISPLAY

public static final String COMMAND_DISPLAY
See Also:
Constant Field Values

COMMAND_TRANSLATE

public static final String COMMAND_TRANSLATE
See Also:
Constant Field Values

DEFAULT_ADDR_LOCAL

public static final String DEFAULT_ADDR_LOCAL
See Also:
Constant Field Values

DEFAULT_PORT

public static final int DEFAULT_PORT
See Also:
Constant Field Values

DEFAULT_IP_GROUP

public static final String DEFAULT_IP_GROUP
See Also:
Constant Field Values

DEFAULT_ADDR_GROUP

public static final String DEFAULT_ADDR_GROUP
See Also:
Constant Field Values

DEFAULT_TTL

public static final int DEFAULT_TTL
See Also:
Constant Field Values

DEFAULT_DELAY

public static final int DEFAULT_DELAY
See Also:
Constant Field Values

DEFAULT_DISPLAY

public static final int DEFAULT_DISPLAY
See Also:
Constant Field Values

VALID_COMMANDS

public static final String[] VALID_COMMANDS
Constructor Detail

MulticastTest

public MulticastTest(InetAddress addrIface,
                     InetSocketAddress addrGroup,
                     int nTTL,
                     int cSecsDelay,
                     int cbMax,
                     boolean fTranslate)
Construct the MulticastTest object.

Parameters:
addrIface - address of the interface (NIC)
addrGroup - address of the multicast group
nTTL - TTL setting for multicast packets
cSecsDelay - number of seconds to delay between pings
cbMax - max number of bytes in the packet body to display
fTranslate - true to translate and display cluster traffic
Method Detail

main

public static void main(String[] asArg)
Parse and validate the command-line parameters and start the test.

Parameters:
asArg - an array of command line parameters

translateAddress

protected static InetAddress translateAddress(String sAddr)
                                       throws IOException
Convert an address string to an InetAddress.

Parameters:
sAddr - a legal address string
Returns:
a non-null InetSocketAddress object
Throws:
IOException

translateSocketAddress

protected static InetSocketAddress translateSocketAddress(String sAddr)
                                                   throws UnknownHostException
Convert an address:port string to an InetSocketAddress.

Parameters:
sAddr - a legal address string
Returns:
a non-null InetSocketAddress object
Throws:
UnknownHostException

showInstructions

protected static void showInstructions()
Display the command-line instructions.


run

public void run()
Run the test.


initSocket

protected void initSocket()
Open the multicast socket.


displayPacket

public void displayPacket(ReadBuffer buf,
                          InetSocketAddress addr)
                   throws Exception
Throws:
Exception

CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation