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 |
瀏覽器相容性
載入中…