Package org.jboss.netty.channel

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


    if (channel != null) {

      final ChannelFuture cf = channel.close();

      try {
        cf.await();
      } catch (final InterruptedException e) {
        log.warn("# terminate: channel.close() channel interrupted");
      } finally {
        log.warn("# terminate: channel.close() complete");
        channel = null;
View Full Code Here


    if (channel != null) {

      final ChannelFuture cf = channel.close();

      try {
        cf.await();
      } catch (final InterruptedException e) {
        log.warn("# terminate: channel.close() channel interrupted");
      } finally {
        log.warn("# terminate: channel.close() complete");
        channel = null;
View Full Code Here

    if (channel != null) {

      final ChannelFuture cf = channel.close();

      try {
        cf.await();
      } catch (final InterruptedException e) {
        log.warn("# terminate: channel.close() channel interrupted");
      } finally {
        log.warn("# terminate: channel.close() complete");
        channel = null;
View Full Code Here

        ClientBootstrap bootstrap = createClientBootstrap(socksProxyAddress);
        bootstrap.setOptions(configBuilder.getOptions());
        bootstrap.setOption("connectTimeoutMillis", (long) connectTimeout.toMillis());
        bootstrap.setPipelineFactory(new NiftyClientChannelPipelineFactory(maxFrameSize));
        ChannelFuture f = bootstrap.connect(addr);
        f.await();
        Channel channel = f.getChannel();
        if (f.getCause() != null) {
            String message = String.format("unable to connect to %s:%d %s",
                    addr.getHostName(),
                    addr.getPort(),
View Full Code Here

    // Start the connection attempt.
    ClientBootstrap cb = new ClientBootstrap(cf);
    cb.getPipeline().addLast("handler", new OutboundHandler(e.getChannel()));
    ChannelFuture f = cb.connect(new InetSocketAddress(remoteHost, remotePort));
    f.await(); // avoids writing before channel connect is completed
    outboundChannel = f.getChannel();
    f.addListener(new ChannelFutureListener() {
      public void operationComplete(ChannelFuture future) throws Exception {
        if (future.isSuccess()) {
          // Connection attempt succeeded:
View Full Code Here

            {
               while (true)
               {
                  try
                  {
                     boolean ok = future.await(10000);

                     if (!ok)
                     {
                        NettyConnection.log.warn("Timed out waiting for packet to be flushed");
                     }
View Full Code Here

         {
            while (true)
            {
               try
               {
                  boolean ok = future.await(10000);

                  if (!ok)
                  {
                     NettyConnection.log.warn("Timed out waiting for packet to be flushed");
                  }
View Full Code Here

    // Close the channel:
    if (channelToClose != null) {
      ChannelFuture closeFuture = channelToClose.close();
      if (awaitCompletion && (closeFuture != null)) {
        try {
          closeFuture.await(connectTimeoutMillis);
        } catch (InterruptedException e) {
          Thread.currentThread().interrupt();   // Reset interrupt flag
          LOG.warn("Interrupted while disconnecting", e);
        }
      }
View Full Code Here

      stateLock.readLock().unlock();
    }
   
    if (!writeFuture.isDone()) {
      try {
        writeFuture.await();
      } catch (InterruptedException e) {
        Thread.currentThread().interrupt();   // Reset interrupt flag
        throw new IOException("Interrupted while writing Netty data pack", e);
      }
    }
View Full Code Here

    if (channel != null) {

      final ChannelFuture cf = channel.close();

      try {
        cf.await();
      } catch (final InterruptedException e) {
        log.warn("# terminate: channel.close() channel interrupted");
      } finally {
        log.warn("# terminate: channel.close() complete");
        channel = null;
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.