Package io.netty.channel

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


      else
      {
         future = bootstrap.connect(remoteDestination);
      }

      future.awaitUninterruptibly();

      if (future.isSuccess())
      {
         final Channel ch = future.channel();
         SslHandler sslHandler = ch.pipeline().get(SslHandler.class);
View Full Code Here


            log.warn("createChannel: try to lock channel table, but timeout, {}ms", LockTimeoutMillis);
        }

        if (cw != null) {
            ChannelFuture channelFuture = cw.getChannelFuture();
            if (channelFuture.awaitUninterruptibly(this.nettyClientConfig.getConnectTimeoutMillis())) {
                if (cw.isOK()) {
                    log.info("createChannel: connect remote host[{}] success, {}", addr,
                        channelFuture.toString());
                    return cw.getChannel();
                }
View Full Code Here

        serverChannel = sb.bind(new InetSocketAddress(0)).sync().channel();
        int port = ((InetSocketAddress) serverChannel.localAddress()).getPort();

        ChannelFuture ccf = cb.connect(new InetSocketAddress(NetUtil.LOCALHOST, port));
        assertTrue(ccf.awaitUninterruptibly().isSuccess());
        clientChannel = ccf.channel();
    }

    @After
    public void teardown() throws Exception {
View Full Code Here

        serverChannel = sb.bind(new InetSocketAddress(0)).sync().channel();
        int port = ((InetSocketAddress) serverChannel.localAddress()).getPort();

        ChannelFuture ccf = cb.connect(new InetSocketAddress(NetUtil.LOCALHOST, port));
        assertTrue(ccf.awaitUninterruptibly().isSuccess());
        clientChannel = ccf.channel();

        assertTrue(latch.await(5, SECONDS));
    }
View Full Code Here

        serverChannel = sb.bind(new InetSocketAddress(0)).sync().channel();
        int port = ((InetSocketAddress) serverChannel.localAddress()).getPort();

        ChannelFuture ccf = cb.connect(new InetSocketAddress(NetUtil.LOCALHOST, port));
        assertTrue(ccf.awaitUninterruptibly().isSuccess());
        clientChannel = ccf.channel();
        http2Client = clientChannel.pipeline().get(Http2ConnectionHandler.class);
    }

    private ChannelHandlerContext ctx() {
View Full Code Here

        serverChannel = sb.bind(new InetSocketAddress(0)).sync().channel();
        int port = ((InetSocketAddress) serverChannel.localAddress()).getPort();

        ChannelFuture ccf = cb.connect(new InetSocketAddress(NetUtil.LOCALHOST, port));
        assertTrue(ccf.awaitUninterruptibly().isSuccess());
        clientChannel = ccf.channel();
    }

    private void mySetupMutualAuth(File keyFile, File crtFile, String keyPassword)
            throws SSLException, CertificateException, InterruptedException {
View Full Code Here

        serverChannel = sb.bind(new InetSocketAddress(0)).sync().channel();
        int port = ((InetSocketAddress) serverChannel.localAddress()).getPort();

        ChannelFuture ccf = cb.connect(new InetSocketAddress(NetUtil.LOCALHOST, port));
        assertTrue(ccf.awaitUninterruptibly().isSuccess());
        clientChannel = ccf.channel();
    }

    private void runTest() throws Exception {
        runTest(APPLICATION_LEVEL_PROTOCOL);
View Full Code Here

        serverChannel = sb.bind(new InetSocketAddress(0)).sync().channel();
        int port = ((InetSocketAddress) serverChannel.localAddress()).getPort();

        ChannelFuture ccf = cb.connect(new InetSocketAddress(NetUtil.LOCALHOST, port));
        assertTrue(ccf.awaitUninterruptibly().isSuccess());
        clientChannel = ccf.channel();
    }

    private ChannelHandlerContext ctx() {
        return clientChannel.pipeline().firstContext();
View Full Code Here

            ChannelPromise writePromise = newPromise();
            ChannelFuture writeFuture = clientChannel.writeAndFlush(request, writePromise);

            writePromise.awaitUninterruptibly(2, SECONDS);
            assertTrue(writePromise.isSuccess());
            writeFuture.awaitUninterruptibly(2, SECONDS);
            assertTrue(writeFuture.isSuccess());
            awaitRequests();
            verify(serverListener).onHeadersRead(any(ChannelHandlerContext.class), eq(5),
                    eq(http2Headers), eq(0), anyShort(), anyBoolean(), eq(0), eq(true));
            verify(serverListener, never()).onDataRead(any(ChannelHandlerContext.class), anyInt(),
View Full Code Here

            ChannelPromise writePromise = newPromise();
            ChannelFuture writeFuture = clientChannel.writeAndFlush(request, writePromise);

            writePromise.awaitUninterruptibly(2, SECONDS);
            assertTrue(writePromise.isSuccess());
            writeFuture.awaitUninterruptibly(2, SECONDS);
            assertTrue(writeFuture.isSuccess());
            awaitRequests();
            verify(serverListener).onHeadersRead(any(ChannelHandlerContext.class), eq(3), eq(http2Headers), eq(0),
                    anyShort(), anyBoolean(), eq(0), eq(false));
            verify(serverListener).onDataRead(any(ChannelHandlerContext.class), eq(3), any(ByteBuf.class), eq(0),
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.