Package org.jboss.netty.channel

Examples of org.jboss.netty.channel.ChannelFuture.awaitUninterruptibly()


                LOG.info("Reconnect started for {}... [{}]", name(), tried);
                LOG.debug("connection started...");

                ChannelFuture future = bootstrap.connect(remote_addr);
                future.awaitUninterruptibly();
                Channel current = future.getChannel();
                if (!future.isSuccess()) {
                    if (null != current) {
                        current.close();
                    }
View Full Code Here


        // Configure the pipeline factory.
        bootstrap.setPipelineFactory(new PipelineFactory());
        ChannelFuture future = bootstrap.connect(new InetSocketAddress(host, port));

        // Wait until the connection attempt succeeds or fails.
        channel = future.awaitUninterruptibly().getChannel();
        if (!future.isSuccess())
        {
            bootstrap.releaseExternalResources();
            throw new IOException("Connection Error", future.getCause());
        }
View Full Code Here

      // Start the connection attempt.
      ChannelFuture future = bootstrap.connect(serverAddress);

      // Wait until the connection attempt succeeds or fails.
      channel = future.awaitUninterruptibly().getChannel();
      if (!future.isSuccess()) {
         bootstrap.releaseExternalResources();
         throw new TransportException("Could not create netty transport", future.getCause());
      }
   }
View Full Code Here

         }
      }
      address = new InetSocketAddress(host, port);

      ChannelFuture future = bootstrap.connect(address);
      future.awaitUninterruptibly();

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

         final Channel ch = future.getChannel();
         SslHandler sslHandler = ch.getPipeline().get(SslHandler.class);
         if (sslHandler != null)
         {
            ChannelFuture handshakeFuture = sslHandler.handshake();
            handshakeFuture.awaitUninterruptibly();
            if (handshakeFuture.isSuccess())
            {
               ch.getPipeline().get(HornetQChannelHandler.class).active = true;
            }
            else
View Full Code Here

      {
         try
         {
            ChannelFuture sslCloseFuture = sslHandler.close();

            if (!sslCloseFuture.awaitUninterruptibly(10000))
            {
               NettyConnection.log.warn("Timed out waiting for ssl close future to complete");
            }
         }
         catch (Throwable t)
View Full Code Here

         }
      }

      ChannelFuture closeFuture = channel.close();

      if (!closeFuture.awaitUninterruptibly(10000))
      {
         NettyConnection.log.warn("Timed out waiting for channel to close");
      }

      closed = true;
View Full Code Here

         }
      }
      address = new InetSocketAddress(host, port);

      ChannelFuture future = bootstrap.connect(address);
      future.awaitUninterruptibly();

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

         final Channel ch = future.getChannel();
         SslHandler sslHandler = ch.getPipeline().get(SslHandler.class);
         if (sslHandler != null)
         {
            ChannelFuture handshakeFuture = sslHandler.handshake();
            handshakeFuture.awaitUninterruptibly();
            if (handshakeFuture.isSuccess())
            {
               ch.getPipeline().get(HornetQChannelHandler.class).active = true;
            }
            else
View Full Code Here

      stateLock.writeLock().lock();
      try {
        if (!isChannelReady(channel)) {
          LOG.debug("Connecting to " + remoteAddr);
          ChannelFuture channelFuture = bootstrap.connect(remoteAddr);
          channelFuture.awaitUninterruptibly(connectTimeoutMillis);
          if (!channelFuture.isSuccess()) {
            throw new IOException("Error connecting to " + remoteAddr,
                channelFuture.getCause());
          }
          channel = channelFuture.getChannel();
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.