public void run() { // Configure the client. ClientBootstrap bootstrap = new ClientBootstrap( new NioClientSocketChannelFactory( Executors.newCachedThreadPool(), Executors.newCachedThreadPool())); // Set up the pipeline factory. bootstrap.setPipelineFactory(new ChannelPipelineFactory() { public ChannelPipeline getPipeline() throws Exception { return Channels.pipeline( new EchoClientHandler(firstMessageSize)); } }); // Start the connection attempt. ChannelFuture future = bootstrap.connect(new InetSocketAddress(host, port)); // Wait until the connection is closed or the connection attempt fails. future.getChannel().getCloseFuture().awaitUninterruptibly(); // Shut down thread pools to exit. bootstrap.releaseExternalResources(); }
public void run() { // Configure the client. ClientBootstrap bootstrap = new ClientBootstrap( new NioClientSocketChannelFactory( Executors.newCachedThreadPool(), Executors.newCachedThreadPool())); // Set up the pipeline factory. bootstrap.setPipelineFactory(new ChannelPipelineFactory() { public ChannelPipeline getPipeline() throws Exception { return Channels.pipeline( new DiscardClientHandler(firstMessageSize)); } }); // Start the connection attempt. ChannelFuture future = bootstrap.connect(new InetSocketAddress(host, port)); // Wait until the connection is closed or the connection attempt fails. future.getChannel().getCloseFuture().awaitUninterruptibly(); // Shut down thread pools to exit. bootstrap.releaseExternalResources(); }
channel.getCloseFuture().awaitUninterruptibly(); break;
channel.getCloseFuture().awaitUninterruptibly(); break;
channel.getCloseFuture().awaitUninterruptibly();
ch.getCloseFuture().awaitUninterruptibly(); } finally { if (ch != null) {
channelFuture.getChannel().getCloseFuture().awaitUninterruptibly();
public void run() { // Configure the client. ClientBootstrap bootstrap = new ClientBootstrap( new SctpClientSocketChannelFactory( Executors.newCachedThreadPool(), Executors.newCachedThreadPool())); final ExecutionHandler executionHandler = new ExecutionHandler( new OrderedMemoryAwareThreadPoolExecutor(16, 1048576, 1048576)); // Set up the pipeline factory. bootstrap.setPipelineFactory(new ChannelPipelineFactory() { @Override public ChannelPipeline getPipeline() throws Exception { return Channels.pipeline(executionHandler, new SctpClientHandler()); } }); bootstrap.setOption("sendBufferSize", 1048576); bootstrap.setOption("receiveBufferSize", 1048576); bootstrap.setOption("sctpNoDelay", true); // Start the connection attempt. ChannelFuture future = bootstrap.connect(new InetSocketAddress(host, port)); // Wait until the connection is closed or the connection attempt fails. future.getChannel().getCloseFuture().awaitUninterruptibly(); // Please check SctpClientHandler to see, how echo message is sent & received // Shut down thread pools to exit. bootstrap.releaseExternalResources(); }
channel.getCloseFuture().awaitUninterruptibly();
channelFuture.getChannel().getCloseFuture().awaitUninterruptibly(); System.err.println("End " + j);
channel.getCloseFuture().awaitUninterruptibly(); return bodylist;
channel.getCloseFuture().awaitUninterruptibly();