Package io.netty.channel

Examples of io.netty.channel.ChannelFuture.channel()


                 }
             });

            ChannelFuture f = b.connect().sync();

            f.channel().closeFuture().sync();
        } finally {
            group.shutdownGracefully().sync();
        }
    }
View Full Code Here


                            new RSFCodec(),//
                            new ServerHandler(manager));
                }
            }).option(ChannelOption.SO_BACKLOG, 128).childOption(ChannelOption.SO_KEEPALIVE, true);
            ChannelFuture f = b.bind(host, port).sync();
            f.channel().closeFuture().sync();
        } finally {
            manager.getLoopGroup().shutdownGracefully();
            bossGroup.shutdownGracefully();
        }
    }
View Full Code Here

            //发起100万次调用.
            ChannelFuture f = b.connect(host, port).sync();
            {
                for (int i = 0; i < 1000000; i++) {
                    RequestMsg req = getData();
                    f.channel().writeAndFlush(req).await();
                }
            }
            // Wait until the connection is closed.
            f.channel().closeFuture().sync();
        } finally {
View Full Code Here

                    RequestMsg req = getData();
                    f.channel().writeAndFlush(req).await();
                }
            }
            // Wait until the connection is closed.
            f.channel().closeFuture().sync();
        } finally {
            manager.getLoopGroup().shutdownGracefully();
        }
    }
    //
View Full Code Here

            future = boot.connect(remoteAddress, localAddress);
        } else {
            future = boot.connect(remoteAddress);
        }
        //
        NetworkChanne connection = new NetworkChanne(future.channel());
        return new NettyRsfClient(connection, this.rsfContext);
    }
}
View Full Code Here

            }
            handle.event(new State.Connecting());
            //XXX who is escaping this?
            req.setUri(req.getUri().replaceAll("%5f", "_"));
            ChannelFuture fut = bootstrap.connect(url.getHost().toString(), url.getPort().intValue());
            fut.channel().attr(KEY).set(info);
            handle.setFuture(fut);
            if (!monitors.isEmpty()) {
                for (ActivityMonitor m : monitors) {
                    m.onStartRequest(url);
                }
View Full Code Here

            handle.setFuture(fut);
            if (!monitors.isEmpty()) {
                for (ActivityMonitor m : monitors) {
                    m.onStartRequest(url);
                }
                fut.channel().closeFuture().addListener(new AdapterCloseNotifier(url));
            }

            fut.addListener(new ChannelFutureListener() {

                @Override
View Full Code Here

            try {
                ChannelFuture fut = future;
                if (fut != null) {
                    fut.cancel(true);
                }
                if (fut != null && fut.channel() != null && fut.channel().isOpen()) {
                    fut.channel().close();
                }
            } finally {
                if (forTimeout != null) {
                    event(new State.Timeout(forTimeout));
View Full Code Here

            try {
                ChannelFuture fut = future;
                if (fut != null) {
                    fut.cancel(true);
                }
                if (fut != null && fut.channel() != null && fut.channel().isOpen()) {
                    fut.channel().close();
                }
            } finally {
                if (forTimeout != null) {
                    event(new State.Timeout(forTimeout));
View Full Code Here

                ChannelFuture fut = future;
                if (fut != null) {
                    fut.cancel(true);
                }
                if (fut != null && fut.channel() != null && fut.channel().isOpen()) {
                    fut.channel().close();
                }
            } finally {
                if (forTimeout != null) {
                    event(new State.Timeout(forTimeout));
                } else {
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.