MCPcopy Create free account
hub / github.com/nodejs/node / close

Method close

lib/internal/quic/quic.js:3448–3469  ·  view source on GitHub ↗

* Gracefully closes the session. Any streams created on the session will be * allowed to complete gracefully and any datagrams that have already been * queued for sending will be allowed to complete. Once all streams have been * completed and all datagrams have been sent, the session will b

(options = kEmptyObject)

Source from the content-addressed store, hash-verified

3446 * @returns {Promise<void>}
3447 */
3448 close(options = kEmptyObject) {
3449 assertIsQuicSession(this);
3450 options = validateCloseOptions(options);
3451 const inner = this.#inner;
3452 if (!this.#isClosedOrClosing) {
3453 inner.isPendingClose = true;
3454 if (options?.code !== undefined) {
3455 inner.selfInitiatedClose = true;
3456 }
3457
3458 debug('gracefully closing the session');
3459
3460 this.#handle.gracefulClose(options);
3461 if (onSessionClosingChannel.hasSubscribers) {
3462 onSessionClosingChannel.publish({
3463 __proto__: null,
3464 session: this,
3465 });
3466 }
3467 }
3468 return this.closed;
3469 }
3470
3471 /** @type {boolean} */
3472 get closing() {

Callers 1

[SymbolAsyncDispose]Method · 0.95

Calls 3

validateCloseOptionsFunction · 0.85
debugFunction · 0.50
publishMethod · 0.45

Tested by

no test coverage detected