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;