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