diff --git a/doc/api/quic.md b/doc/api/quic.md index 19995000b20e..577d1e8348b6 100644 --- a/doc/api/quic.md +++ b/doc/api/quic.md @@ -1948,6 +1948,24 @@ an `ERR_QUIC_APPLICATION_ERROR` or `ERR_QUIC_TRANSPORT_ERROR` when the stream is closed due to a QUIC error (e.g., stream reset by the peer, CONNECTION\_CLOSE with a non-zero error code). +### `stream.cancel([reason])` + + + +* `reason` {string} Optional human-readable reason. + +Cancels the stream: abruptly terminates both directions, signaling to the +peer that the request or response was deliberately abandoned. `STOP_SENDING` +is sent for a still-open readable side and `RESET_STREAM` for a still-open +writable side. When the negotiated application protocol defines a +cancellation code ([RFC 9114 section 4.1.1][] defines `H3_REQUEST_CANCELLED` +for HTTP/3) the frames carry it; other application protocols use their +"no error" code. + +The call does nothing if the stream is already destroyed. + ### `stream.destroy([error[, options]])`