From b8945ba2ab518023d37c0a56dd15c12996046f02 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 9 Jul 2020 12:43:51 -0700 Subject: [PATCH] quic: clarifying code comments PR-URL: https://github.com/nodejs/node/pull/34283 Reviewed-By: Anna Henningsen --- lib/internal/quic/core.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/internal/quic/core.js b/lib/internal/quic/core.js index 9995b935b1c17c..04ff53e6a4483e 100644 --- a/lib/internal/quic/core.js +++ b/lib/internal/quic/core.js @@ -717,6 +717,13 @@ class QuicEndpoint { this[kHandle] = undefined; handle[owner_symbol] = undefined; + // Calling waitForPendingCallbacks starts the process of + // closing down the QuicEndpoint. Once all pending writes + // to the underlying libuv udp handle have completed, the + // ondone callback will be invoked, triggering the UDP + // socket to be closed. Once it is closed, we notify + // the QuicSocket that this QuicEndpoint has been closed, + // allowing it to be freed. handle.ondone = () => { state.udpSocket.close((err) => { if (err) error = err; @@ -747,6 +754,7 @@ class QuicEndpoint { return {}; } + // On Windows, this always returns undefined. get fd() { return this[kInternalState].fd >= 0 ? this[kInternalState].fd : undefined;