From b80108c033325c00dabbde945522e7f3535a3977 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 9 Jul 2020 13:40:23 -0700 Subject: [PATCH] quic: restrict addEndpoint to before QuicSocket bind Restricting this to pre-bind keeps things simple PR-URL: https://github.com/nodejs/node/pull/34283 Reviewed-By: Anna Henningsen --- doc/api/quic.md | 5 ++++- lib/internal/quic/core.js | 15 ++++++--------- test/parallel/test-quic-quicendpoint-address.js | 5 +++++ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/doc/api/quic.md b/doc/api/quic.md index b21d432642580b..d16b0a853e19fa 100644 --- a/doc/api/quic.md +++ b/doc/api/quic.md @@ -1458,7 +1458,10 @@ added: REPLACEME **Default**: `'udp4'`. * Returns: {QuicEndpoint} -Creates and adds a new `QuicEndpoint` to the `QuicSocket` instance. +Creates and adds a new `QuicEndpoint` to the `QuicSocket` instance. An +error will be thrown if `quicsock.addEndpoint()` is called either after +the `QuicSocket` has already started binding to the local ports or after +the `QuicSocket` has been destroyed. #### quicsocket.bound