TCPUDPServerManager.java 文件源码

java
阅读 29 收藏 0 点赞 0 评论 0

项目:dnd 作者:
/**
 * Initializes a new UDPMulticastBeacon.
 * 
 * @param serverConfig
 *            a configuration to use for initializing
 * @return the new UDPMulticastBeacon
 */
private UDPMulticastBeacon initializeBeacon(final AddressBasedServerConfig serverConfig) {
    LOGGER.entry();
    final OioEventLoopGroup networkEventLoopGroup = new OioEventLoopGroup();
    eventExecutorGroups.add(networkEventLoopGroup);

    final UDPMulticastBeacon beacon =
            new UDPMulticastBeacon(OIO_DATAGRAM_CHANNEL_FACTORY, networkEventLoopGroup, scheduledExecutorService,
                    serverConfig.getModuleID(), serverConfig.getAnnounceInterval(), TimeUnit.SECONDS);
    beacon.addListener((TCPConnectionManager) getConnectionManager());
    beacon.setAnnounceAddresses(new ArrayList<InetSocketAddress>(serverConfig.getAnnounceAddresses()));

    for (final NetConnection netConnection : serverConfig.getMulticastAddresses()) {
        LOGGER.debug("adding address {} to beacon", netConnection);
        beacon.addAddress(netConnection.getInterface(), netConnection.getAddress());
    }

    return LOGGER.exit(beacon);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号