Class WebTransportReceiveStream
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NOTE
ExperimentalWebTransportReceiveStream interface of the {{domxref("WebTransport API", "WebTransport API", "", "nocode")}} is a ReadableStream that can be used to read from an incoming unidirectional or bidirectional WebTransport stream.
[Value("WebTransportReceiveStream")]
public class WebTransportReceiveStream : ReadableStream
- Inheritance
-
WebTransportReceiveStream
- Inherited Members
Remarks
The stream is a readable byte stream of Uint8Array, and can be consumed using either a BYOB reader (ReadableStreamBYOBReader) or the default reader (ReadableStreamDefaultReader).
Objects of this type are not constructed directly.
Instead they are obtained using the WebTransport.incomingUnidirectionalStream property.
WebTransportReceiveStream is a transferable object.
-Using WebTransport
-{{domxref("Streams API", "Streams API", "", "nocode")}}
-WebTransport over HTTP/3
Constructors
WebTransportReceiveStream()
public WebTransportReceiveStream()
Methods
GetStats()
NOTE
ExperimentalgetStats() method of the WebTransportReceiveStream interface asynchronously returns an object containing statistics for the current stream.
[Value("getStats")]
public Task<WebTransportReceiveStreamStats> GetStats()
Returns
- Task<WebTransportReceiveStreamStats>
A Promise that resolves to a object containing statistics about the current stream.
The returned object has the following properties:
Remarks
The statistics include the total number of ordered bytes that have arrived on this stream (ignoring network overhead, up until the first missing byte) and the total number that have been read by the application.
It therefore provides a measure of how quickly the application is consuming bytes from the server on this particular stream.