RTCDtlsTransport: error event - Web APIs 编辑

An RTCDtlsTransport receives an error event when a transport-level error occurs on the RTCPeerConnection.

BubblesYes
CancelableNo
InterfaceRTCErrorEvent
Event handler propertyonerror

The RTCErrorEvent object provides details about the error that occurred; see that article for details.

Description

Transport-level errors will have one of the following values for the specified error's RTCError property errorDetail:

dtls-failure
The negotiation of the DTLS connection failed, or the connection was terminated with a fatal error. The error's message contains details about the nature of the error. If a fatal error is received, the error object's receivedAlert property is set to the value of the DTLSL alert received. If, on the other hand, a fatal error was sent, the sentAlert is set to the alert's value.
fingerprint-failure
The remote certificate for the RTCDtlsTransport didn't match any of the fingerprints listed in the SDP. If the remote peer can't match the local certificate against the provided fingerprints, this error doesn't occur, though this situation may result instead in a dtls-failure error.

Examples

In this example, the onerror event handler property is used to set the handler for the error event.

transport.onerror = ev => {
  const err = ev.error;

  /* ... */
}

Note: Since RTCError is not one of the legacy errors, the value of RTCError.code is always 0.

Specifications

SpecificationStatusComment
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCDtlsTransport: error event' in that specification.
Candidate RecommendationInitial specification.

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:108 次

字数:4286

最后编辑:8年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文