Example usage for io.netty.channel.group ChannelGroupFuture iterator

List of usage examples for io.netty.channel.group ChannelGroupFuture iterator

Introduction

In this page you can find the example usage for io.netty.channel.group ChannelGroupFuture iterator.

Prototype

@Override
Iterator<ChannelFuture> iterator();

Source Link

Document

Returns the Iterator that enumerates all ChannelFuture s which are associated with this future.

Usage

From source file:com.github.mrstampy.gameboot.netty.NettyConnectionRegistry.java

License:Open Source License

private void log(ChannelGroupFuture e, String groupName) {
    e.iterator().forEachRemaining(cf -> log(cf, groupName));
}

From source file:com.linkedin.mitm.proxy.ProxyServer.java

License:Open Source License

/**
 * Stop proxy server/*from w  ww .  ja va 2 s .c  om*/
 * */
public void stop() {
    ChannelGroupFuture future = _allChannels.close().awaitUninterruptibly();
    if (!future.isSuccess()) {
        final Iterator<ChannelFuture> iter = future.iterator();
        while (iter.hasNext()) {
            final ChannelFuture cf = iter.next();
            if (!cf.isSuccess()) {
                LOG.warn(String.format("Failed to close channel %s because %s", cf.channel(), cf.cause()));
            }
        }
    }
    _acceptorGroup.shutdownGracefully();
    _upstreamWorkerGroup.shutdownGracefully();
    _downstreamWorkerGroup.shutdownGracefully();
}