WebTransportSendStream
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.
Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.
Note: This feature is available inWeb Workers.
TheWebTransportSendStream
interface of theWebTransport API is a specializedWritableStream
that is used to send outbound data in both unidirectional or bidirectionalWebTransport
streams.
The send stream is awritable stream ofUint8Array
, 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 theWebTransport.createUnidirectionalStream()
returns an object of this type for sending data.When creating a bidirectional stream usingWebTransport.createBidirectionalStream()
, the method returns aWebTransportBidirectionalStream
, and the send stream object can be obtained from itswritable
property.When a bidirectional stream is initiated by the remote end, an object of this type can similarly be obtained usingWebTransport.incomingBidirectionalStreams
.
WebTransportSendStream
is atransferable object.
In this article
Instance properties
Also inherits properties from its parent interface,WritableStream
.
WebTransportSendStream.getStats()
ExperimentalReturns a
Promise
that resolves with statistics related to this stream.
Instance methods
Also inherits methods from its parent interface,WritableStream
.
WebTransportSendStream.sendOrder
ExperimentalIndicates the send priority of this stream relative to other streams for which the value has been set.
Examples
SeeWebTransport.incomingUnidirectionalStreams
for an example of how to get aReadableStream
ofWebTransportSendStream
objects.
Specifications
Specification |
---|
WebTransport> # webtransportsendstream> |
Browser compatibility
Loading…