MCPcopy Index your code
hub / github.com/nodejs/node / close

Method close

lib/internal/http2/core.js:1639–1652  ·  view source on GitHub ↗
(callback)

Source from the content-addressed store, hash-verified

1637 // set but the goaway will not be sent until after the connect event
1638 // is emitted.
1639 close(callback) {
1640 if (this.closed || this.destroyed)
1641 return;
1642 debugSessionObj(this, 'marking session closed');
1643 this[kState].flags |= SESSION_FLAGS_CLOSED;
1644 if (typeof callback === 'function')
1645 this.once('close', callback);
1646 this.goaway();
1647 const handle = this[kHandle];
1648 if (handle) {
1649 handle.setGracefulClose();
1650 }
1651 this[kMaybeDestroy]();
1652 }
1653
1654 [EventEmitter.captureRejectionSymbol](err, event, ...args) {
1655 switch (event) {

Callers

nothing calls this directly

Calls 3

goawayMethod · 0.95
debugSessionObjFunction · 0.85
onceMethod · 0.45

Tested by

no test coverage detected