code: void handleClosed() {
      if (!closed) {
        closed = true;
  
        for (ContextualFuture<?> responseFuture : responseFutures.values()) {
          responseFuture.context.executor().execute(() -> responseFuture.completeExceptionally(new ConnectException("connection closed")));
        }
        responseFutures.clear();
  
        for (Listener<Connection> listener : closeListeners) {
          listener.accept(this);
        }
        timeout.cancel();
      }
    }
docs: Handles the channel being closed.