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

Method goaway

lib/internal/http2/core.js:1588–1604  ·  view source on GitHub ↗
(code = NGHTTP2_NO_ERROR, lastStreamID = 0, opaqueData)

Source from the content-addressed store, hash-verified

1586 // session with the notable exception that new incoming streams will
1587 // be rejected automatically.
1588 goaway(code = NGHTTP2_NO_ERROR, lastStreamID = 0, opaqueData) {
1589 if (this.destroyed)
1590 throw new ERR_HTTP2_INVALID_SESSION();
1591
1592 if (opaqueData !== undefined) {
1593 validateBuffer(opaqueData, 'opaqueData');
1594 }
1595 validateNumber(code, 'code');
1596 validateNumber(lastStreamID, 'lastStreamID');
1597
1598 const goawayFn = submitGoaway.bind(this, code, lastStreamID, opaqueData);
1599 if (this.connecting) {
1600 this.once('connect', goawayFn);
1601 return;
1602 }
1603 goawayFn();
1604 }
1605
1606 // Destroy the Http2Session, making it no longer usable and cancelling
1607 // any pending activity.

Calls 2

bindMethod · 0.45
onceMethod · 0.45

Tested by

no test coverage detected