equal
deleted
inserted
replaced
57 ProtocolFamily family = StandardProtocolFamily.INET; |
57 ProtocolFamily family = StandardProtocolFamily.INET; |
58 if (target.group() instanceof Inet6Address) |
58 if (target.group() instanceof Inet6Address) |
59 family = StandardProtocolFamily.INET6; |
59 family = StandardProtocolFamily.INET6; |
60 DatagramChannel dc = DatagramChannel.open(family).bind(new InetSocketAddress(0)); |
60 DatagramChannel dc = DatagramChannel.open(family).bind(new InetSocketAddress(0)); |
61 if (target.interf() != null) { |
61 if (target.interf() != null) { |
62 dc.setOption(StandardSocketOption.IP_MULTICAST_IF, target.interf()); |
62 dc.setOption(StandardSocketOptions.IP_MULTICAST_IF, target.interf()); |
63 } |
63 } |
64 |
64 |
65 // send multicast packet |
65 // send multicast packet |
66 dc.send(Charset.defaultCharset().encode(args[1]), |
66 dc.send(Charset.defaultCharset().encode(args[1]), |
67 new InetSocketAddress(target.group(), target.port())); |
67 new InetSocketAddress(target.group(), target.port())); |