From 9f552df5b4892530e3c8cabc31705b265c317304 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 9 Jul 2020 13:52:15 -0700 Subject: [PATCH] quic: fix endpointClose error handling, document PR-URL: https://github.com/nodejs/node/pull/34283 Reviewed-By: Anna Henningsen --- doc/api/quic.md | 15 +++++++++++++++ lib/internal/quic/core.js | 9 +++++++-- test/parallel/test-quic-client-server.js | 2 ++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/doc/api/quic.md b/doc/api/quic.md index d16b0a853e19fa..46f521789ef799 100644 --- a/doc/api/quic.md +++ b/doc/api/quic.md @@ -1354,6 +1354,21 @@ Emitted after the `QuicSocket` has been destroyed and is no longer usable. The `'close'` event will not be emitted multiple times. +#### Event: `'endpointClose'` + + +Emitted after a `QuicEndpoint` associated witht the `QuicSocket` closes and +has been destroyed. The handler will be invoked with two arguments: + +* `endpoint` {QuicEndpoint} The `QuicEndpoint` that has been destroyed. +* `error` {Error} An `Error` object if the `QuicEndpoint` was destroyed because + of an error. + +When all of the `QuicEndpoint` instances associated with a `QuicSocket` have +closed, the `QuicEndpoint` will also automatically close. + #### Event: `'error'`