private static DatagramChannel multicastListener(final InetAddress address, final int port) throws IOException
{
final NetworkInterface networkInterface = getMulticastCapableNetworkInterface();
final DatagramChannel channel = DatagramChannel.open(StandardProtocolFamily.INET);
channel.bind(new InetSocketAddress(address, port));
channel.setOption(StandardSocketOptions.SO_REUSEADDR, true);
channel.setOption(StandardSocketOptions.IP_MULTICAST_IF, networkInterface);
channel.join(address, networkInterface);
return channel;
}
ExampleApplication.java 文件源码
java
阅读 21
收藏 0
点赞 0
评论 0
项目:angler
作者:
评论列表
文章目录