code: public synchronized void onTransportTermination() {
      if (state != State.DISCONNECTED) {
        state = State.DISCONNECTED;
        if (shutdownFuture != null) {
          shutdownFuture.cancel(false);
        }
        if (pingFuture != null) {
          pingFuture.cancel(false);
          pingFuture = null;
        }
      }
    }
docs: Transport is being terminated. We no longer need to do keepalives.