All,

I've cleaned up the MulticastTool a bit to add '--help' output that describes 
the options (you just had to magically know before).  As well I've added a few 
options.  And cleaned up the output overall.

The goal of the tool is to aid in debugging a non-functioning multicast setup ( 
http://openejb.apache.org/3.0/failover.html )

I've checked this into the 3.1.x branch.  If we find any issues with current 
3.1.3 release candidate, we may want to consider merging this in.

Here's what the output looks like:




$ java -cp target/openejb-client-3.1.3-SNAPSHOT.jar 
org.apache.openejb.client.MulticastTool --help
  
  Options:
   -h,  --host=String            Address of the multicast channel. Default is 
239.255.3.2
   -p,  --port=int               Port of the multicast channel. Default is 6142
        --date-format=String     Date format to use for log lines. Default is 
HH:mm:ss
  
  Sending:
   -s,  --send=String            Optional message to broadcast to the channel.
   -r,  --rate=long              Resend every N milliseconds. Zero sends just 
once. Default is 1000
  
  Advanced:
        --broadcast=boolean      java.net.MulticastSocket#setBroadcast.
        --loopback-mode=boolean  java.net.MulticastSocket#setLoopbackMode.
        --receive-buffer-size=int  
java.net.MulticastSocket#setReceiveBufferSize.
        --reuse-address=boolean  java.net.MulticastSocket#setReuseAddress.
        --send-buffer-size=int   java.net.MulticastSocket#setSendBufferSize.
        --so-timeout=int         java.net.MulticastSocket#setSoTimeout.
        --time-to-live=int       java.net.MulticastSocket#setTimeToLive.
        --traffic-class=int      java.net.MulticastSocket#setTrafficClass.


$ java -cp target/openejb-client-3.1.3-SNAPSHOT.jar 
org.apache.openejb.client.MulticastTool --port 4312 --send blue 

  Connected
   host                : 239.255.3.2
   port                : 4312
  
  Socket
   broadcast           : true
   loopback-mode       : false
   receive-buffer-size : 65507
   reuse-address       : true
   send-buffer-size    : 65507
   so-timeout          : 0
   time-to-live        : 1
   traffic-class       : 0
  
  Sending
   send                : orange
   rate                : 1000
  
  Listening....
  16:43:47 - 192.168.42.22 - orange
  16:43:48 - 192.168.42.22 - blue
  16:43:48 - 192.168.42.22 - orange
  16:43:49 - 192.168.42.22 - blue
  16:43:49 - 192.168.42.22 - orange
  16:43:50 - 192.168.42.22 - blue
  16:43:50 - 192.168.42.22 - orange

Reply via email to