@@ -1903,9 +1903,14 @@ True if `stream.destroy()` has been called. |
1903 | 1903 |
|
1904 | 1904 | ### Aborting a stream |
1905 | 1905 |
|
1906 | | -A QuicStream can be aborted in three ways, each producing different |
| 1906 | +A QuicStream can be aborted in several ways, each producing different |
1907 | 1907 | wire-frame side effects: |
1908 | 1908 |
|
| 1909 | +* [`stream.stopSending()`][] — Aborts only the readable side. Sends |
| 1910 | + `STOP_SENDING` to the peer. The writable side is unaffected. |
| 1911 | +* [`stream.resetStream()`][] — Aborts only the writable side. Sends |
| 1912 | + `RESET_STREAM` to the peer. Unlike [`writer.fail(reason)`][], the wire |
| 1913 | + code is given directly rather than derived from an error. |
1909 | 1914 | * [`writer.fail(reason)`][] — Aborts only the writable side. Sends |
1910 | 1915 | `RESET_STREAM` to the peer. The readable side is unaffected; any data |
1911 | 1916 | already buffered for read remains available. |
@@ -1923,6 +1928,46 @@ the wire code for both `writer.fail()` and `stream.destroy()`. Otherwise |
1923 | 1928 | the implementation falls back to the negotiated application protocol's |
1924 | 1929 | "internal error" code (see [`QuicError`][]). |
1925 | 1930 |
|
| 1931 | +[`stream.stopSending()`][] and [`stream.resetStream()`][] do |
| 1932 | +not perform this derivation: they send `code` as given. |
| 1933 | + |
| 1934 | +### `stream.resetStream([code])` |
| 1935 | + |
| 1936 | +<!-- YAML |
| 1937 | +added: v23.8.0 |
| 1938 | +--> |
| 1939 | + |
| 1940 | +* `code` {number|bigint} The application error code to send to the peer. |
| 1941 | + **Default:** `0n`. |
| 1942 | + |
| 1943 | +Tells the peer that this end will not send any more data on this stream, |
| 1944 | +sending a `RESET_STREAM` frame carrying `code`. The readable side is left |
| 1945 | +open, so data already sent by the peer remains available to read. |
| 1946 | + |
| 1947 | +Any data still queued for sending is discarded. A reset stream is never |
| 1948 | +acknowledged by the peer, so the outbound queue can no longer drain. |
| 1949 | + |
| 1950 | +No acknowledgement of this action is provided. The call does nothing if the |
| 1951 | +stream has been destroyed, if it has already been reset, or if it is a |
| 1952 | +remote-initiated unidirectional stream, which has no writable side to abort. |
| 1953 | + |
| 1954 | +### `stream.stopSending([code])` |
| 1955 | + |
| 1956 | +<!-- YAML |
| 1957 | +added: v23.8.0 |
| 1958 | +--> |
| 1959 | + |
| 1960 | +* `code` {number|bigint} The application error code to send to the peer. |
| 1961 | + **Default:** `0n`. |
| 1962 | + |
| 1963 | +Asks the peer to stop sending data on this stream, sending a `STOP_SENDING` |
| 1964 | +frame carrying `code`. The writable side is left open, so this end can |
| 1965 | +still send data. |
| 1966 | + |
| 1967 | +No acknowledgement of this action is provided. The call does nothing if the |
| 1968 | +stream has been destroyed, or if it is a locally-initiated unidirectional |
| 1969 | +stream, which has no readable side to abort. |
| 1970 | + |
1926 | 1971 | ### `stream.early` |
1927 | 1972 |
|
1928 | 1973 | <!-- YAML |
@@ -4556,11 +4601,13 @@ throughput issues caused by flow control. |
4556 | 4601 | [`stream.onwanttrailers`]: #streamonwanttrailers |
4557 | 4602 | [`stream.pendingTrailers`]: #streampendingtrailers |
4558 | 4603 | [`stream.priority`]: #streampriority |
| 4604 | +[`stream.resetStream()`]: #streamresetstreamcode |
4559 | 4605 | [`stream.sendHeaders()`]: #streamsendheadersheaders-options |
4560 | 4606 | [`stream.sendInformationalHeaders()`]: #streamsendinformationalheadersheaders |
4561 | 4607 | [`stream.sendTrailers()`]: #streamsendtrailersheaders |
4562 | 4608 | [`stream.setBody()`]: #streamsetbodybody |
4563 | 4609 | [`stream.setPriority()`]: #streamsetpriorityoptions |
| 4610 | +[`stream.stopSending()`]: #streamstopsendingcode |
4564 | 4611 | [`stream.writer`]: #streamwriter |
4565 | 4612 | [`writer.fail()`]: #streamwriter |
4566 | 4613 | [`writer.fail(reason)`]: #streamwriter |
|