Package io.netty.channel.nio

Examples of io.netty.channel.nio.NioEventLoopGroup.register()


        // Do something which takes some amount of time

        // Register channel again on eventloop
        Channel channel = future.channel();
        group.register(channel).addListener(new ChannelFutureListener() {
            @Override
            public void operationComplete(ChannelFuture future) throws Exception {
                if (future.isSuccess()) {
                    System.out.println("Channel registered");
                } else {
View Full Code Here


                        ChannelFuture cf = ctx.deregister();
                        cf.addListener(new ChannelFutureListener() {
                            @Override
                            public void operationComplete(ChannelFuture future) throws Exception {
                                group2.register(future.channel());
                            }
                        });
                    }
                });
        ChannelFuture future = bootstrap.connect(new InetSocketAddress("www.manning.com", 80));
View Full Code Here

        EventExecutor unwrapped1 = executor1.unwrap();
        EventExecutor executor3 = future.channel().pipeline().context(TestChannelHandler2.class).executor();

        future.channel().deregister().sync();

        Channel channel = group2.register(future.channel()).sync().channel();
        EventExecutor executor2 = channel.pipeline().context(TestChannelHandler1.class).executor();

        // same wrapped executor
        assertSame(executor1, executor2);
        // different executor under the wrapper
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.