Skip to content

Commit 8bd61d4

Browse files
committed
quic: documentation updates
PR-URL: #34351 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 086c916 commit 8bd61d4

File tree

1 file changed

+54
-17
lines changed

1 file changed

+54
-17
lines changed

doc/api/quic.md

+54-17
Original file line numberDiff line numberDiff line change
@@ -2115,15 +2115,6 @@ stream('initialHeaders', (headers) => {
21152115
});
21162116
```
21172117

2118-
#### Event: `'ready'`
2119-
<!-- YAML
2120-
added: REPLACEME
2121-
-->
2122-
2123-
Emitted when the underlying `QuicSession` has emitted its `secure` event
2124-
this stream has received its id, which is accessible as `stream.id` once this
2125-
event is emitted.
2126-
21272118
#### Event: `'trailingHeaders'`
21282119
<!-- YAML
21292120
added: REPLACEME
@@ -2158,7 +2149,10 @@ added: REPLACEME
21582149

21592150
* Type: {boolean}
21602151

2161-
Set to `true` if the `QuicStream` is bidirectional.
2152+
When `true`, the `QuicStream` is bidirectional. Both the readable and
2153+
writable sides of the `QuicStream` `Duplex` are open.
2154+
2155+
Read-only.
21622156

21632157
#### `quicstream.bytesReceived`
21642158
<!-- YAML
@@ -2169,6 +2163,8 @@ added: REPLACEME
21692163

21702164
The total number of bytes received for this `QuicStream`.
21712165

2166+
Read-only.
2167+
21722168
#### `quicstream.bytesSent`
21732169
<!-- YAML
21742170
added: REPLACEME
@@ -2178,24 +2174,29 @@ added: REPLACEME
21782174

21792175
The total number of bytes sent by this `QuicStream`.
21802176

2177+
Read-only.
2178+
21812179
#### `quicstream.clientInitiated`
21822180
<!-- YAML
21832181
added: REPLACEME
21842182
-->
21852183

21862184
* Type: {boolean}
21872185

2188-
Set to `true` if the `QuicStream` was initiated by a `QuicClientSession`
2186+
Will be `true` if the `QuicStream` was initiated by a `QuicClientSession`
21892187
instance.
21902188

2191-
#### `quicstream.close(code)`
2189+
Read-only.
2190+
2191+
#### `quicstream.close()`
21922192
<!-- YAML
21932193
added: REPLACEME
21942194
-->
21952195

2196-
* `code` {number}
2196+
* Returns: {Promise`}
21972197

2198-
Closes the `QuicStream`.
2198+
Closes the `QuicStream` by ending both sides of the `QuicStream` `Duplex`.
2199+
Returns a `Promise` that is resolved once the `QuicStream` has been destroyed.
21992200

22002201
#### `quicstream.dataAckHistogram`
22012202
<!-- YAML
@@ -2226,6 +2227,8 @@ added: REPLACEME
22262227

22272228
The length of time the `QuicStream` has been active.
22282229

2230+
Read-only.
2231+
22292232
#### `quicstream.finalSize`
22302233
<!-- YAML
22312234
added: REPLACEME
@@ -2235,6 +2238,8 @@ added: REPLACEME
22352238

22362239
The total number of bytes successfully received by the `QuicStream`.
22372240

2241+
Read-only.
2242+
22382243
#### `quicstream.id`
22392244
<!-- YAML
22402245
added: REPLACEME
@@ -2244,6 +2249,8 @@ added: REPLACEME
22442249

22452250
The numeric identifier of the `QuicStream`.
22462251

2252+
Read-only.
2253+
22472254
#### `quicstream.maxAcknowledgedOffset`
22482255
<!-- YAML
22492256
added: REPLACEME
@@ -2253,6 +2260,8 @@ added: REPLACEME
22532260

22542261
The highest acknowledged data offset received for this `QuicStream`.
22552262

2263+
Read-only.
2264+
22562265
#### `quicstream.maxExtendedOffset`
22572266
<!-- YAML
22582267
added: REPLACEME
@@ -2262,6 +2271,8 @@ added: REPLACEME
22622271

22632272
The maximum extended data offset that has been reported to the connected peer.
22642273

2274+
Read-only.
2275+
22652276
#### `quicstream.maxReceivedOffset`
22662277
<!-- YAML
22672278
added: REPLACEME
@@ -2271,6 +2282,8 @@ added: REPLACEME
22712282

22722283
The maximum received offset for this `QuicStream`.
22732284

2285+
Read-only.
2286+
22742287
#### `quicstream.pushStream(headers\[, options\])`
22752288
<!-- YAML
22762289
added: REPLACEME
@@ -2304,17 +2317,22 @@ added: REPLACEME
23042317

23052318
* Type: {boolean}
23062319

2307-
Set to `true` if the `QuicStream` was initiated by a `QuicServerSession`
2320+
Will be `true` if the `QuicStream` was initiated by a `QuicServerSession`
23082321
instance.
23092322

2323+
Read-only.
2324+
23102325
#### `quicstream.session`
23112326
<!-- YAML
23122327
added: REPLACEME
23132328
-->
23142329

23152330
* Type: {QuicSession}
23162331

2317-
The `QuicServerSession` or `QuicClientSession`.
2332+
The `QuicServerSession` or `QuicClientSession` to which the
2333+
`QuicStream` belongs.
2334+
2335+
Read-only.
23182336

23192337
#### `quicstream.sendFD(fd\[, options\])`
23202338
<!-- YAML
@@ -2395,7 +2413,26 @@ added: REPLACEME
23952413

23962414
* Type: {boolean}
23972415

2398-
Set to `true` if the `QuicStream` is unidirectional.
2416+
Will be `true` if the `QuicStream` is undirectional. Whether the `QuicStream`
2417+
will be readable or writable depends on whether the `quicstream.session` is
2418+
a `QuicClientSession` or `QuicServerSession`, and whether the `QuicStream`
2419+
was initiated locally or remotely.
2420+
2421+
| `quicstream.session` | `quicstream.serverInitiated` | Readable | Writable |
2422+
| -------------------- | ---------------------------- | -------- | -------- |
2423+
| `QuicClientSession` | `true` | Y | N |
2424+
| `QuicServerSession` | `true` | N | Y |
2425+
| `QuicClientSession` | `false` | N | Y |
2426+
| `QuicServerSession` | `false` | Y | N |
2427+
2428+
| `quicstream.session` | `quicstream.clientInitiated` | Readable | Writable |
2429+
| -------------------- | ---------------------------- | -------- | -------- |
2430+
| `QuicClientSession` | `true` | N | Y |
2431+
| `QuicServerSession` | `true` | Y | N |
2432+
| `QuicClientSession` | `false` | Y | N |
2433+
| `QuicServerSession` | `false` | N | Y |
2434+
2435+
Read-only.
23992436

24002437
## Additional notes
24012438

0 commit comments

Comments
 (0)