事件:'newSession'
\Event: 'newSession'
版本历史
| 版本 | 变更 |
|---|---|
| v0.11.12 | 现在支持 |
| v0.9.2 | 新增于: v0.9.2 |
在创建新的 TLS 会话时触发 'newSession' 事件。这可用于在外部存储中存储会话。数据应该提供给 'resumeSession' 回调。
\The 'newSession' event is emitted upon creation of a new TLS session. This may
be used to store sessions in external storage. The data should be provided to
the 'resumeSession' callback.
监听器回调在调用时传入三个参数:
\The listener callback is passed three arguments when called:
-
sessionId<Buffer> TLS 会话标识符\
sessionId<Buffer> The TLS session identifier -
sessionData<Buffer> TLS 会话数据\
sessionData<Buffer> The TLS session data -
callback<Function> 回调函数不带参数,必须调用这些参数才能通过安全连接发送或接收数据。\
callback<Function> A callback function taking no arguments that must be invoked in order for data to be sent or received over the secure connection.
监听此事件只会对添加事件监听器后建立的连接有影响。
\Listening for this event will have an effect only on connections established after the addition of the event listener.