Class WebTransportSendStream
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NOTE
ExperimentalWebTransportSendStream interface of the {{domxref("WebTransport API", "WebTransport API", "", "nocode")}} is a specialized WritableStream that is used to send outbound data in both unidirectional or bidirectional WebTransport streams.
[Value("WebTransportSendStream")]
public class WebTransportSendStream : WritableStream
- Inheritance
-
WebTransportSendStream
- Inherited Members
Remarks
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(WebTransportSendStreamOptions) returns an object of this type for sending data.
When creating a bidirectional stream using CreateBidirectionalStream(WebTransportSendStreamOptions), 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.
-Using WebTransport
-{{domxref("Streams API", "Streams API", "", "nocode")}}
-WebTransport over HTTP/3
Constructors
WebTransportSendStream()
public WebTransportSendStream()
Properties
SendGroup
[Value("sendGroup")]
public WebTransportSendGroup? SendGroup { get; set; }
Property Value
SendOrder
NOTE
ExperimentalsendOrder property of the WebTransportSendStream interface indicates the send priority of this stream relative to other streams for which the value has been set.
[Value("sendOrder")]
public long SendOrder { get; set; }
Property Value
- long
A number indicating the relative priority of this stream when sending bytes.
Remarks
Queued bytes are sent first for streams that have a higher value.
If not set, the send order depends on the implementation.
-Using WebTransport
-{{domxref("WebSockets API", "WebSockets API", "", "nocode")}}
-{{domxref("Streams API", "Streams API", "", "nocode")}}
-WebTransport over HTTP/3
Methods
GetStats()
NOTE
ExperimentalgetStats() method of the WebTransportSendStream interface asynchronously returns an object containing statistics for the current stream.
[Value("getStats")]
public Task<WebTransportSendStreamStats> GetStats()
Returns
- Task<WebTransportSendStreamStats>
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 bytes written to the stream, the number that have been sent (ignoring packet overhead), and the number of bytes that have been set at least once, and the number that have been acknowledged (up until the first sequentially-ordered non-acknowledged byte).
It therefore provides a measure of how quickly the application is sending bytes to the server on this particular stream.
GetWriter()
[Value("getWriter")]
public WebTransportWriter GetWriter()