code: private boolean enableKeepalive(PollController conn,
                                    boolean isNew)
        throws IOException
    {
      
      if (_selectMax <= _connectionCount.get()) {
        throw new IllegalStateException(this + " keepalive overflow "
                                        + _connectionCount + " max=" + _selectMax);
  
        /*
        conn.requestDestroy();
  
        return false;
        */
      }
  
      JniSocketImpl socket = (JniSocketImpl) conn.getSocket();
  
      if (socket == null) {
        throw new IllegalStateException(this + " socket empty for " + conn);
      }
  
      int nativeFd = socket.getNativeFd();
  
      if (nativeFd < 0) {
        throw new IllegalStateException(this + " attempted keepalive with closed file descriptor fd=" + nativeFd
                                        + "\n " + socket
                                        + "\n " + conn);
      }
      else if (_connections.length() <= nativeFd) {
        throw new IllegalStateException(this + " select overflow for file descriptor fd=" + nativeFd + " " + conn);
      }
  
      if (! _lifecycle.isActive()) {
        throw new IllegalStateException("inactive keepalive");
      }
  
      if (isNew) {
        setMaxConnection(nativeFd);
  
        _connections.set(nativeFd, conn);
  
        _connectionCount.incrementAndGet();
      }
  
      int result = addNative(_fd, nativeFd, isNew);
  
      // result < 0 would likely be a disconnect
  
      return result == 0;
    }
docs: Enables keepalive and checks to see if data is available.
  
  @return true if a read would block (keepalive is required)