session.destroy([error[, options]])
立即销毁会话。所有流将被销毁,会话将被关闭。如果提供了 error 且设置了 session.onerror,在销毁之前会调用 onerror 回调。session.closed promise 将以错误拒绝。如果提供了 options,发送给对等方的 CONNECTION_CLOSE 帧将包含指定的错误代码、类型和原因。
🌐 Immediately destroy the session. All streams will be destroyed and the
session will be closed. If error is provided and session.onerror is
set, the onerror callback is invoked before destruction. The
session.closed promise will reject with the error. If options is
provided, the CONNECTION_CLOSE frame sent to the peer will include the
specified error code, type, and reason.