Http2Session.destroy - Node documentation
method Http2Session.destroy

Usage in Deno

import { type Http2Session } from "node:http2";
Http2Session.destroy(
error?: Error,
code?: number,
): void

Immediately terminates the Http2Session and the associated net.Socket ortls.TLSSocket.

Once destroyed, the Http2Session will emit the 'close' event. If erroris not undefined, an 'error' event will be emitted immediately before the'close' event.

If there are any remaining open Http2Streams associated with theHttp2Session, those will also be destroyed.

Parameters

optional
error: Error

An Error object if the Http2Session is being destroyed due to an error.

optional
code: number

The HTTP/2 error code to send in the final GOAWAY frame. If unspecified, and error is not undefined, the default is INTERNAL_ERROR, otherwise defaults to NO_ERROR.

Return Type

void