web api interface
WebTransportSendStream
Secure context Available in workers
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 createUnidirectionalStream() returns an object of this type for sending data.
When creating a bidirectional stream using createBidirectionalStream(), the method returns a WebTransportBidirectionalStream, and the send stream object can be obtained from its writable property.
When a bidirectional stream is initiated by the remote end, an object of this type can similarly be obtained using incomingBidirectionalStreams.
WebTransportSendStream is a transferable object.
Instance properties
Also inherits properties from its parent interface, WritableStream.
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.
getStats()- : Returns a
Promisethat resolves with statistics related to this stream.
- : Returns a
getWriter()- : Returns a new
WebTransportWriterobject and locks the stream to it. While the stream is locked, no other writer can be acquired until this one is released.
- : Returns a new
Examples
See WebTransport.incomingUnidirectionalStreams for an example of how to get a ReadableStream of WebTransportSendStream objects.