code: public void preClose() {
      if (explicitClosed.compareAndSet(false, true)) {
        proxy.lock.lock();
        try {
          removeListenerFromSchedulers();
  
          //closing connections
          closeConnection(waitNewSecondaryProtocol.getAndSet(null));
          closeConnection(waitNewMasterProtocol.getAndSet(null));
          closeConnection(masterProtocol);
          closeConnection(secondaryProtocol);
        } finally {
          proxy.lock.unlock();
        }
      }
    }
docs: Called after a call on Connection.close(). Will explicitly closed all connections.