Code example for SocketChannel

Methods: isConnectedisOpen

0
  /** 
   * Checks whether the socket is connected. 
   */ 
  public boolean isOpen() { 
    // isConnected() does not return false after close(), but isOpen() does 
    return socketChannel_.isOpen() && socketChannel_.isConnected();
  } 
 
  /** 
   * Do not call, the implementation provides its own lazy non-blocking connect. 
   */ 
  public void open() throws TTransportException { 
    throw new RuntimeException("open() is not implemented for TNonblockingSocket");
  } 
 
  /** 
   * Perform a nonblocking read into buffer. 
   */ 
  public int read(ByteBuffer buffer) throws IOException {
    return socketChannel_.read(buffer);
  }