public class MulticastChat extends Object
'$ 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 "
UDPNIOConnection
Constructor and Description |
---|
MulticastChat() |
Copyright © 2015 Oracle Corporation. All rights reserved.