RTCPeerConnection: sctp 属性
RTCPeerConnection 接口中只读的 sctp 属性返回一个 RTCSctpTransport 对象,该对象描述了用于发送和接收 SCTP 数据的 SCTP 传输。如果尚未协商 SCTP,则此值为 null。
SCTP 传输用于在对等连接上传输和接收所有 RTCDataChannel 的数据。
值
一个 RTCSctpTransport 对象,它描述了 RTCPeerConnection 用于在数据通道上传输和接收数据的 SCTP 传输,或者在 SCTP 协商尚未发生时返回 null。
示例
js
const peerConnection = new RTCPeerConnection();
const channel = peerConnection.createDataChannel("Mydata");
channel.onopen = (event) => {
channel.send("sending a message");
};
channel.onmessage = (event) => {
console.log(event.data);
};
// Determine the largest message size that can be sent
const sctp = peerConnection.sctp;
const maxMessageSize = sctp.maxMessageSize;
规范
| 规范 |
|---|
| WebRTC:浏览器中的实时通信 # dom-rtcpeerconnection-sctp |
浏览器兼容性
加载中…