MDN Web Docs

Value

A number indicating the relative priority of this stream when sending bytes.

Examples

The example below shows how you can set the initial sendOrder when calling WebTransport.createUnidirectionalStream() to create the send stream, read the value from the stream, and then change the order. After changing the order the priority of this stream would increase, becoming higher than any stream with a priority of less than "596996858".

js

async function writeData() {
  const stream = await transport.createUnidirectionalStream({
    sendOrder: "400", // Set initial stream order
  });
  console.log(`Stream order: ${stream.sendOrder}`); // Stream order: 400
  // write data ...
  // Change the stream order
  stream.sendOrder = 596996858;
  console.log(`Stream order: ${stream.sendOrder}`); // Stream order: 596996858
  // write more data ...
}

Specifications

Specification
WebTransport
# dom-webtransportsendstream-sendorder

Browser compatibility

See also

Help improve MDN

Yes No

Learn how to contribute

This page was last modified on by MDN contributors.

Read the original on developer.mozilla.org ↗