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

Method close

lib/internal/http2/core.js:2424–2438  ·  view source on GitHub ↗
(code = NGHTTP2_NO_ERROR, callback)

Source from the content-addressed store, hash-verified

2422 // close, it is still possible to queue up PRIORITY and RST_STREAM frames,
2423 // but no DATA and HEADERS frames may be sent.
2424 close(code = NGHTTP2_NO_ERROR, callback) {
2425 validateInteger(code, 'code', 0, kMaxInt);
2426
2427 if (callback !== undefined) {
2428 validateFunction(callback, 'callback');
2429 }
2430
2431 if (this.closed)
2432 return;
2433
2434 if (callback !== undefined)
2435 this.once('close', callback);
2436
2437 closeStream(this, code);
2438 }
2439
2440 // Called by this.destroy().
2441 // * Will submit an RST stream to shutdown the stream if necessary.

Callers

nothing calls this directly

Calls 2

closeStreamFunction · 0.85
onceMethod · 0.45

Tested by

no test coverage detected