if (!isOpen()) throw new ClosedChannelException();  if (!connectionPending) throw new NoConnectionPendingException();  if (isConnected()) return true;    Selector selector = provider().openSelector(); register (selector, SelectionKey.OP_CONNECT);  if (isBlocking()) { selector.select(); connected = true; connectionPending = false; return true; }  int ready = selector.selectNow(); if (ready == 1) { connected = true; connectionPending = false; return true; }
  public boolean finishConnect ()  {    return false;  }