Package java.nio.channels

Examples of java.nio.channels.ConnectionPendingException


      synchronized (connectLock) {
        try {

          if (isConnectionPending) {
            close();
            throw new ConnectionPendingException();
          }

          isConnectionPending = true;

          begin();

          socketUDT.connect(remoteSocket);

        } finally {

          end(true);

          isConnectionPending = false;

          connectLock.notifyAll();

        }
      }

      return socketUDT.isConnected();

    } else {

      /** non Blocking */

      if (!isRegistered()) {

        /** this channel is independent of any selector */

        log.error("UDT channel is in NON blocking mode; "
            + "must register with a selector " //
            + "before trying to connect(); " //
            + "socketId=" + socketUDT.id());

        throw new IllegalBlockingModeException();

      }

      /** this channel is registered with a selector */

      synchronized (connectLock) {

        if (isConnectionPending) {
          close();
          log.error("connection already in progress");
          throw new ConnectionPendingException();
        }

        isConnectFinished = false;
        isConnectionPending = true;

View Full Code Here


                if (value != null) {
                    if (channel instanceof XnioClientChannel) {
                        final XnioClientChannel cc = (XnioClientChannel) channel;
                        synchronized (cc.connectLock) {
                            if (cc.connecting) {
                                Exception cause = new ConnectionPendingException();
                                future.setFailure(cause);
                                fireExceptionCaught(channel, cause);
                            } else {
                                cc.connecting = true;
                                java.nio.channels.Channel xnioChannel = cc.xnioChannel;
View Full Code Here

      synchronized (connectLock) {
        try {

          if (isConnectionPending) {
            close();
            throw new ConnectionPendingException();
          }

          isConnectionPending = true;

          begin();

          socketUDT.connect(remoteSocket);

        } finally {

          end(true);

          isConnectionPending = false;

          connectLock.notifyAll();

        }
      }

      return socketUDT.isConnected();

    } else {

      /** non Blocking */

      if (!isRegistered()) {

        /** this channel is independent of any selector */

        log.error("UDT channel is in NON blocking mode; "
            + "must register with a selector " //
            + "before trying to connect(); " //
            + "socketId=" + socketUDT.id());

        throw new IllegalBlockingModeException();

      }

      /** this channel is registered with a selector */

      synchronized (connectLock) {

        if (isConnectionPending) {
          close();
          log.error("connection already in progress");
          throw new ConnectionPendingException();
        }

        isConnectFinished = false;
        isConnectionPending = true;

View Full Code Here

    public final void connect(
            ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress,
            ChannelPromise promise) throws Exception {

        if (destinationAddress != null) {
            promise.setFailure(new ConnectionPendingException());
            return;
        }

        destinationAddress = remoteAddress;
        ctx.connect(proxyAddress, localAddress, promise);
View Full Code Here

TOP

Related Classes of java.nio.channels.ConnectionPendingException

Copyright © 2018 www.massapicom. 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.