Class MulticastChat

java.lang.Object
org.glassfish.grizzly.samples.udpmulticast.MulticastChat

public class MulticastChat extends Object
Simple chat application based on UDP multicast. Requires JDK 1.7+ When you run MulticastChat application, the first thing you might want to know is network interfaces' names available on your system (command #6), so type:
'$ 6'
and press enter to see the interfaces and check if they support multicasting. On my system I see:
 "
 $6
 wlan0 support-multicast=true
 eth0 support-multicast=true
 lo support-multicast=false
 "
 
which means I can use wlan0 and eth0 interfaces to test multicasting. So now I have to join the multicasting group
 "
 $2 228.5.6.7 eth0
 "
 
The output would be like:
 "
 Tue Sep 11 16:09:42 CEST 2012 /10.163.25.1:8888: joined the group /228.5.6.7
 "
 
Run MulticastChat application on different machine (it's better to use local network, cause multicasting might be blocked by routers), run the same/similar commands, so both clients join the same multicast group. To send message to the multicast group use the command like:
 "
 $1 228.5.6.7 hello
 "
 
Author:
Alexey Stashok
See Also:
  • UDPNIOConnection
  • Constructor Details

    • MulticastChat

      public MulticastChat()
  • Method Details