Package org.jboss.netty.bootstrap

Examples of org.jboss.netty.bootstrap.ClientBootstrap.releaseExternalResources()


        // Print out the answer.
        System.err.format(
                "Factorial of %,d is: %,d", count, handler.getFactorial());

        // Shut down all thread pools to exit.
        bootstrap.releaseExternalResources();
    }

    public static void main(String[] args) throws Exception {
        // Print usage if no argument is specified.
        if (args.length != 3) {
View Full Code Here


        sh.channel.close().awaitUninterruptibly();
        ch.channel.close().awaitUninterruptibly();
        sc.close().awaitUninterruptibly();
        cb.shutdown();
        sb.shutdown();
        cb.releaseExternalResources();
        sb.releaseExternalResources();

        if (sh.exception.get() != null && !(sh.exception.get() instanceof IOException)) {
            throw sh.exception.get();
        }
View Full Code Here

        Assert.assertTrue(cc.getCloseFuture().awaitUninterruptibly(5000));

        serverChannel.close();

        cb.releaseExternalResources();
        sb.releaseExternalResources();
    }
}
View Full Code Here

        sh.channel.close().awaitUninterruptibly();
        ch.channel.close().awaitUninterruptibly();
        sc.close().awaitUninterruptibly();
        cb.shutdown();
        sb.shutdown();
        cb.releaseExternalResources();
        sb.releaseExternalResources();

        if (sh.exception.get() != null && !(sh.exception.get() instanceof IOException)) {
            throw sh.exception.get();
        }
View Full Code Here

        sh.channel.close().awaitUninterruptibly();
        ch.channel.close().awaitUninterruptibly();
        sc.close().awaitUninterruptibly();
        cb.shutdown();
        sb.shutdown();
        cb.releaseExternalResources();
        sb.releaseExternalResources();

        if (eventExecutor != null) {
            eventExecutor.shutdown();
        }
View Full Code Here

        ch.channel.close().awaitUninterruptibly();
        sc.close().awaitUninterruptibly();
        cb.shutdown();
        sb.shutdown();

        cb.releaseExternalResources();
        sb.releaseExternalResources();

        if (sh.exception.get() != null && !(sh.exception.get() instanceof IOException)) {
            throw sh.exception.get();
        }
View Full Code Here

                assertFalse("should not be invalid", writtenFrame.isInvalid());

                sc.close().awaitUninterruptibly();
                cb.shutdown();
                sb.shutdown();
                cb.releaseExternalResources();
                sb.releaseExternalResources();
            }
        }
    }
View Full Code Here

        for (int i = 0; i < rounds; i++) {
            connectAndSend(cb, port);
        }

        cb.shutdown();
        cb.releaseExternalResources();
        sc.close().awaitUninterruptibly();
        sb.shutdown();
        sb.releaseExternalResources();
    }
View Full Code Here

        assertTrue(cf.isSuccess());
        assertTrue(cf.getChannel().close().awaitUninterruptibly().isSuccess());

        assertNull(handler.await());
        sb.releaseExternalResources();
        cb.releaseExternalResources();
    }

    static final class ExceptionHandler extends SimpleChannelUpstreamHandler {
        private final CountDownLatch latch = new CountDownLatch(1);
        private Throwable t;
View Full Code Here

        // Wait until the connection is closed, or the connection attempt fails
        connectFuture.getChannel().getCloseFuture().awaitUninterruptibly();

        sb.releaseExternalResources();
        cb.releaseExternalResources();

        assertNull(String.format("Expected null, got channel '%s' for local address '%s'", LocalChannelRegistry.getChannel(addr), addr), LocalChannelRegistry.getChannel(addr));
    }

    @Test
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.