Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2020-07-14 20:51:00 +0300
committerJames M Snell <jasnell@gmail.com>2020-07-23 16:52:53 +0300
commit086c916997a23041d6687d7fca8e0d5109d1f4a2 (patch)
tree58810faa56415b9acb2ac4d6b539ee4289fc74a1 /doc/api/quic.md
parentcf28f8a7dddedb90f96f177cc1c83c29fda39578 (diff)
quic: extensive refactoring of QuicStream lifecycle
This one was a bit of a rabbit hole... but, with this set of changes, `QuicStream` should now work with autoDestroy, supports a promisified `close()`, and fixes a number of other internal bugs that were spotted trying to get it to work. PR-URL: https://github.com/nodejs/node/pull/34351 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'doc/api/quic.md')
-rw-r--r--doc/api/quic.md8
1 files changed, 5 insertions, 3 deletions
diff --git a/doc/api/quic.md b/doc/api/quic.md
index c877cd12a6f..a6cd2ecd91c 100644
--- a/doc/api/quic.md
+++ b/doc/api/quic.md
@@ -183,10 +183,12 @@ The `openStream()` method is used to create a new `QuicStream`:
```js
// Create a new bidirectional stream
-const stream1 = await session.openStream();
+async function createStreams(session) {
+ const stream1 = await session.openStream();
-// Create a new unidirectional stream
-const stream2 = await session.openStream({ halfOpen: true });
+ // Create a new unidirectional stream
+ const stream2 = await session.openStream({ halfOpen: true });
+}
```
As suggested by the names, a bidirectional stream allows data to be sent on