From 392f3f2a68d9f9b7bfb56ff42c99a683b16b26a1 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sat, 26 Oct 2019 20:47:41 +0200 Subject: [PATCH] quic: add pending state for streams This resolves the situation in which `openStream()` is called before the underlying native `QuicSession` handle exists. Fixes: https://github.com/nodejs/quic/issues/181 PR-URL: https://github.com/nodejs/quic/pull/187 Reviewed-By: James M Snell --- doc/api/quic.md | 19 ++++++++++ lib/internal/quic/core.js | 77 ++++++++++++++++++++++++++++----------- 2 files changed, 75 insertions(+), 21 deletions(-) diff --git a/doc/api/quic.md b/doc/api/quic.md index 573da7e4f0..7a12753c7d 100644 --- a/doc/api/quic.md +++ b/doc/api/quic.md @@ -1102,6 +1102,15 @@ stream('initialHeaders', (headers) => { }); ``` +### Event: `'ready'` + + +Emitted when the underlying `QuicSession` has emitted its `secure` event +this stream has received its id, which is accessible as `stream.id` once this +event is emitted. + ### Event: `'trailingHeaders'` + +* {boolean} + +This property is `true` if the underlying session is not finished yet, +i.e. before the `'ready'` event is emitted. + ### quicstream.serverInitiated