(code = NGHTTP2_NO_ERROR, lastStreamID = 0, opaqueData)
| 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. |
no test coverage detected