Package org.jboss.netty.channel

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


        }

        @Override
        public Void get() throws InterruptedException,
            ExecutionException {
          future.await();
          if (!future.isSuccess()) {
            throw new ExecutionException(future.getCause());
          }
          return null;
        }
View Full Code Here


        @Override
        public Void get(long arg0, TimeUnit arg1)
            throws InterruptedException, ExecutionException,
            TimeoutException {
          if (future.await(arg0, arg1)) {
            if (!future.isSuccess()) {
              throw new ExecutionException(future.getCause());
            }
            return null;
          }
View Full Code Here

      if (_channel != null && _channel.isOpen())
        try
        {
          ChannelFuture cf = _channel.close();
          getLog().info("controller close session");
          cf.await(1000);
        }
        catch (InterruptedException e)
        {
          e.printStackTrace();
          getLog().info("session close wait interrupted in JVMController");
View Full Code Here

         
           // Start the connection attempt.
          ChannelFuture future = bootstrap.connect(new InetSocketAddress(host.getName(), host.getPort()));
          try
        {
          future.await(10000);
          connected = future.isSuccess();


          if (connected)
          {
View Full Code Here

            if (_session != null && _session.isConnected() && !_stopping && !_appearHanging)
            {
              ChannelFuture future = _session.write(new Message(Constants.WRAPPER_MSG_PING, null));
              try
              {
                future.await(10000);
              }
              catch (InterruptedException e)
              {
                e.printStackTrace();
              }
View Full Code Here

      if (_debug)
        log.fine("connecting to port " + _port);
      final ChannelFuture future1 = connector.connect();
      try
      {
        future1.await();
        _started = future1.isSuccess();
      }
      catch (InterruptedException e1)
      {
        // TODO Auto-generated catch block
View Full Code Here

    {
    super.flush();
    if (future == null)
    {
      ChannelFuture f = sendDownstream(null);
      f.await(20000);
      //if (!f.await(10000))
      //  throw new IOException("write longer than 10 secs");
    }
    else
    {
View Full Code Here

    // first send session and wait until it has been transmitted
    ChannelFuture future = Channels.future(ctx.getChannel());
    Channels.write(ctx, future, ChannelBuffers.wrappedBuffer(session.getId().getBytes()));
    try
    {
      future.await();
    }
    catch (InterruptedException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here

         
           // Start the connection attempt.
          ChannelFuture future = bootstrap.connect(new InetSocketAddress(host.getName(), host.getPort()));
          try
        {
          future.await(10000);
          connected = future.isSuccess();


          if (connected)
          {
View Full Code Here

    ChannelFuture writeFuture = childChannel.write(response);
    if (timeoutMillis > 0)
    {
      try
      {
        writeFuture.await(timeoutMillis);
      }
      catch (InterruptedException e)
      {
        //NOOP
      }
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.