大网数据广告活动
Web 标准与前端开发

WebTransportDatagramsWritable

· 52CE 我爱测

The **`WebTransportDatagramsWritable`** interface of the WebTransport API is a specialized WritableStream that can be used to write outgoing datagrams to a WebTransport connection.

WebTransport API

The WebTransportDatagramsWritable interface of the WebTransport API is a specialized WritableStream that can be used to write outgoing datagrams to a WebTransport connection.

WebTransportDatagramsWritable is a transferable object.

Instance properties

Also inherits properties from its parent interface, WritableStream.

  • WebTransportDatagramsWritable.sendGroup
    • : Gets or sets a WebTransportSendGroup that the stream's datagrams are grouped under for the purposes of sendOrder prioritization.
  • WebTransportDatagramsWritable.sendOrder
    • : Gets or sets an integer indicating the priority of this stream relative to other streams and datagrams in the same sendGroup.

Instance methods

Inherits methods from its parent interface, WritableStream.

Description

In addition to the functionality of a standard WritableStream, the WebTransportDatagramsWritable interface provides the sendGroup property that indicates the group of streams and datagrams that this stream belongs to, and the sendOrder property that indicates the relative priority of this stream within that group. Within a group, bytes queued on higher-priority streams and datagrams are sent before any bytes from lower-priority ones. Different groups are expected to be treated as equals for the purposes of bandwidth allocation — though the precise way bandwidth is divided between groups is implementation-defined.

Objects of this type are not constructed directly. Instead, an instance is returned by the WebTransportDatagramDuplexStream.createWritable method of WebTransportDatagramDuplexStream, which can be accessed using the WebTransport.datagrams property.

The transmission is unreliable, meaning that even though you can define the priority order, there is no guarantee that every datagram will be sent, or that they will arrive in any particular order.

Examples

See WebTransportDatagramDuplexStream.createWritable for an example showing how to create a WebTransportDatagramsWritable and use it to write outgoing datagrams.

Specifications

Browser compatibility

See also

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。