http2stream.close(code[, callback])


  • code <number> 未签名的 32 位整数,用于识别错误代码。 默认值: http2.constants.NGHTTP2_NO_ERROR (0x00)。
  • callback <Function> 一个可选的函数,用于监听 'close' 事件。

通过向连接的 HTTP/2 对端发送 RST_STREAM 帧来关闭 Http2Stream 实例。

🌐 Closes the Http2Stream instance by sending an RST_STREAM frame to the connected HTTP/2 peer.