ChannelGroupFuture () { EventLoopGroup eventLoopGroup = null; for (Channel channel : openChannels) { if (channel instanceof ServerChannel) { eventLoopGroup = channel.eventLoop().parent(); break; } } try { return openChannels.close(); } finally { if (eventLoopGroup != null) { eventLoopGroup.shutdownGracefully(0, 15, TimeUnit.SECONDS); } } }