code: public void close() {
      if (socketChannel == null) {
        return;
      }
  
      monitor.remove(socketChannel);
      try {
        socketChannel.close();
      } catch (IOException ignored) {
        /* nothing to be done */
      } finally {
        socketChannel = null;
      }
    }
docs: Switches the wait state and wakes up the selector to process.