http2session.destroy([error][, code])
error<Error> 如果Http2Session因错误而被销毁,则为Error对象。code<number> 要在最终GOAWAY帧中发送的 HTTP/2 错误代码。 如果未指定,且error未未定义,则默认为INTERNAL_ERROR,否则默认为NO_ERROR。
立即终止 Http2Session 和相关联的 net.Socket 或 tls.TLSSocket。
一旦销毁,则 Http2Session 将触发 'close' 事件。
如果 error 未定义,则将在 'close' 事件之前立即触发 'error' 事件。
如果有任何剩余的与 Http2Session 关联的开放 Http2Streams,则它们也会被销毁。
error<Error> AnErrorobject if theHttp2Sessionis being destroyed due to an error.code<number> The HTTP/2 error code to send in the finalGOAWAYframe. If unspecified, anderroris not undefined, the default isINTERNAL_ERROR, otherwise defaults toNO_ERROR.
Immediately terminates the Http2Session and the associated net.Socket or
tls.TLSSocket.
Once destroyed, the Http2Session will emit the 'close' event. If error
is not undefined, an 'error' event will be emitted immediately before the
'close' event.
If there are any remaining open Http2Streams associated with the
Http2Session, those will also be destroyed.