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

WebTransportSendStream

· 52CE 我爱测

The `WebTransportSendStream` interface of the WebTransport API is a specialized WritableStream that is used to send outbound data in both unidirectional or bidirectional WebTransport streams.

WebTransport API

The WebTransportSendStream interface of the WebTransport API is a specialized WritableStream that is used to send outbound data in both unidirectional or bidirectional WebTransport streams.

The send stream is a writable stream of Uint8Array, that can be written to in order to send data to a server. It additionally provides streaming features such as setting the send order, and getting stream statistics.

Objects of this type are not constructed directly. When creating a unidirectional stream the WebTransport.createUnidirectionalStream() returns an object of this type for sending data. When creating a bidirectional stream using WebTransport.createBidirectionalStream(), the method returns a WebTransportBidirectionalStream, and the send stream object can be obtained from its WebTransportBidirectionalStream.writable property. When a bidirectional stream is initiated by the remote end, an object of this type can similarly be obtained using WebTransport.incomingBidirectionalStreams.

WebTransportSendStream is a transferable object.

Instance properties

Also inherits properties from its parent interface, WritableStream.

  • WebTransportSendStream.sendGroup
    • : The WebTransportSendGroup that this stream is grouped under for the purposes of sendOrder prioritization.
  • WebTransportSendStream.sendOrder
    • : Indicates the send priority of this stream relative to other streams for which the value has been set.

Instance methods

Also inherits methods from its parent interface, WritableStream.

  • WebTransportSendStream.getStats()
    • : Returns a Promise that resolves with statistics related to this stream.
  • WebTransportSendStream.getWriter()
    • : Returns a new WebTransportWriter object and locks the stream to it. While the stream is locked, no other writer can be acquired until this one is released.

Examples

See WebTransport.incomingUnidirectionalStreams for an example of how to get a ReadableStream of WebTransportSendStream objects.

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

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

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