WebTransportDatagramsWritable

The WebTransportDatagramsWritable interface of the WebTransport API is a specialized WritableStream that can be used to write outgoing datagrams to a WebTransport connection. Available only in secure contexts.

MDN Reference

Properties

Link copied to clipboard
open external val locked: Boolean

The locked read-only property of the WritableStream interface returns a boolean indicating whether the WritableStream is locked to a writer.

Link copied to clipboard
open external var sendGroup: WebTransportSendGroup?

The sendGroup property of the WebTransportDatagramsWritable interface represents the WebTransportSendGroup that this WebTransportDatagramsWritable is grouped under for the purposes of sendOrder prioritization.

Link copied to clipboard
open external var sendOrder: Int53

The sendOrder property of the WebTransportDatagramsWritable interface represents the priority of this stream's datagrams relative to other streams and datagrams in the same sendGroup, as an integer.

Functions

Link copied to clipboard
inline suspend fun <W : JsAny?> WritableStream<W>.abort()
inline suspend fun <W : JsAny?> WritableStream<W>.abort(reason: JsError?)

The abort() method of the WritableStream interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.

Link copied to clipboard
open external fun abortAsync(reason: JsError? = definedExternally): Promise<Void>

The abort() method of the WritableStream interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.

Link copied to clipboard
inline suspend fun <W : JsAny?> WritableStream<W>.close()

The close() method of the WritableStream interface closes the associated stream. All chunks written before this method is called are sent before the returned promise is fulfilled.

Link copied to clipboard
open external fun closeAsync(): Promise<Void>

The close() method of the WritableStream interface closes the associated stream. All chunks written before this method is called are sent before the returned promise is fulfilled.

Link copied to clipboard

The getWriter() method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance. While the stream is locked, no other writer can be acquired until this one is released.