docs: public void close() {
          synchronized(factory.cnxns){
              // if this is not in cnxns then it's already closed
              if (!factory.cnxns.remove(this)) {
                  return;
              }
  
              synchronized (factory.ipMap) {
                  Set<NIOServerCnxn> s =
                      factory.ipMap.get(sock.socket().getInetAddress());
                  s.remove(this);
              }
  
              // unregister from JMX
              try {
                  if(jmxConnectionBean != null){
                      MBeanRegistry.getInstance().unregister(jmxConnectionBean);
                  }
              } catch (Exception e) {
                  LOG.warn("Failed to unregister with JMX", e);
              }
              jmxConnectionBean = null;
  
              if (zk != null) {
                  zk.removeCnxn(this);
              }
  
              closeSock();
  
              if (sk != null) {
                  try {
                      // need to cancel this selection key from the selector
                      sk.cancel();
                  } catch (Exception e) {
                      if (LOG.isDebugEnabled()) {
                          LOG.debug("ignoring exception during selectionkey cancel", e);
                      }
                  }
              }
          }
      }