(error = NGHTTP2_NO_ERROR, code)
| 1606 | // Destroy the Http2Session, making it no longer usable and cancelling |
| 1607 | // any pending activity. |
| 1608 | destroy(error = NGHTTP2_NO_ERROR, code) { |
| 1609 | if (this.destroyed) |
| 1610 | return; |
| 1611 | |
| 1612 | debugSessionObj(this, 'destroying'); |
| 1613 | |
| 1614 | if (typeof error === 'number') { |
| 1615 | code = error; |
| 1616 | error = |
| 1617 | code !== NGHTTP2_NO_ERROR ? |
| 1618 | new ERR_HTTP2_SESSION_ERROR(code) : undefined; |
| 1619 | } |
| 1620 | if (code === undefined && error != null) |
| 1621 | code = NGHTTP2_INTERNAL_ERROR; |
| 1622 | |
| 1623 | closeSession(this, code, error); |
| 1624 | } |
| 1625 | |
| 1626 | // Closing the session will: |
| 1627 | // 1. Send a goaway frame |
no test coverage detected