WebTransport: congestionControl 属性
注意:此功能在 Web Workers 中可用。
WebTransport 接口的只读属性 congestionControl 指示了应用程序在发送数据时偏好高吞吐量还是低延迟。
该值在 WebTransport() 构造函数选项中设置。
值
一个字符串,其值可能为以下之一:
default-
传输的默认拥塞控制调整。这是默认值。
throughput-
应用程序偏好拥塞控制针对吞吐量进行调整。
low-latency-
应用程序偏好拥塞控制针对低延迟进行调整。
示例
此示例演示了如何获取 congestionControl 偏好设置。由于未在构造函数中显式设置,因此结果为 default。
js
const url = "https://example.com:4999/wt";
const transport = new WebTransport(url);
console.log(transport.congestionControl); // default
规范
| 规范 |
|---|
| WebTransport # dom-webtransport-congestioncontrol |
浏览器兼容性
加载中…