protected boolean close(boolean checkQueue, boolean stoppedNormally) {
    // If the client is durable and either (a) it hasn't stopped normally or (b) it
    // has stopped normally but it is configured to be kept alive, set pauseDurable
    // to true
    final boolean pauseDurable =
        isDurable() && (!stoppedNormally || (getDurableKeepAlive() && stoppedNormally));

    boolean keepProxy = false;
    if (pauseDurable) {
      pauseDispatching();
      keepProxy = true;
    } else {
      terminateDispatching(checkQueue);
      closeTransientFields();
    }

    connected = false;

    // Close the Authorization callback or subject if we are not keeping the proxy
    try {
      if (!pauseDurable) {
        cleanClientAuths();
      }
    } catch (Exception ex) {
      logger.warn("{}", this, ex);
    }
    // Notify the caller whether to keep this proxy. If the proxy is durable
    // and should be paused, then return true; otherwise return false.
    return keepProxy;
  }
Close the <code>CacheClientProxy</code>.

@param checkQueue Whether to message check the queue and process any contained messages (up to
       MAXIMUM_SHUTDOWN_PEEKS).
@param stoppedNormally Whether client stopped normally

@return whether to keep this <code>CacheClientProxy</code>
@see CacheClientProxy#MAXIMUM_SHUTDOWN_PEEKS
geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java