From 6665dda9f60e7478cd45df9c18be51ef4d71938e Mon Sep 17 00:00:00 2001 From: James M Snell Date: Fri, 10 Jul 2020 12:38:04 -0700 Subject: [PATCH] quic: implement QuicSocket Promise API, part 2 PR-URL: https://github.com/nodejs/node/pull/34283 Reviewed-By: Anna Henningsen --- doc/api/quic.md | 7 +- lib/internal/quic/core.js | 151 ++++++++---------- ...t-quic-quicsession-server-destroy-early.js | 12 +- test/parallel/test-quic-quicsocket-close.js | 13 +- 4 files changed, 82 insertions(+), 101 deletions(-) diff --git a/doc/api/quic.md b/doc/api/quic.md index 318f48cc62094e..cb3180e0cdf66a 100644 --- a/doc/api/quic.md +++ b/doc/api/quic.md @@ -1584,16 +1584,17 @@ with this `QuicSocket`. Read-only. -#### quicsocket.close(\[callback\]) +#### quicsocket.close() -* `callback` {Function} +* Returns: {Promise} Gracefully closes the `QuicSocket`. Existing `QuicSession` instances will be permitted to close naturally. New `QuicClientSession` and `QuicServerSession` -instances will not be allowed. +instances will not be allowed. The returns `Promise` will be resolved once +the `QuicSocket` is destroyed. #### quicsocket.connect(\[options\])