createUnidirectionalStream method
The createUnidirectionalStream()
method of the WebTransport
interface asynchronously opens a unidirectional stream.
The method returns a Promise
that resolves to a WritableStream object,
which can be used to reliably write data to the server.
"Reliable" means that transmission and order of data are guaranteed. This provides slower delivery (albeit faster than with WebSockets) than WebTransport.datagrams, but is needed in situations where reliability and ordering are important, like chat applications.
The relative order in which queued bytes are emptied from created streams
can be specified using the sendOrder
option.
If set, queued bytes in streams with a higher send order are guaranteed to
be sent before queued bytes for streams with a lower send order.
If the order number is not set then the order in which bytes are sent is
implementation dependent.
Note however that even though bytes from higher send-order streams are
sent first, they may not arrive first.
Implementation
external JSPromise<JSObject> createUnidirectionalStream(
[WebTransportSendStreamOptions options]);