class WebSocketMessageWriter
source · line 11public class WebSocketMessageWriter internal constructor(private val state: WsState, private val message: WsOutgoing) : AsyncByteSink, AsyncCloseable
- Supertype
AsyncByteSink - Supertype
AsyncCloseable
The active outgoing message. Short writes respect configured frame size; finish emits FIN after any compression boundary completes.
property type
source · line 16public val type: WebSocketMessageType
get: public read-only
The Text or Binary message category.
getter get
source · line 16get(): WebSocketMessageType
function flush
source · line 45public override suspend fun flush(): Unit
- Overrides
flush
Flushes accepted bytes, including a compression synchronization point when active, without emitting FIN.
function close
source · line 68public override suspend fun close(): Unit
- Overrides
close
Closes the writer. Abandoning an unfinished message aborts its session.
property isCompressed
source · line 20public val isCompressed: Boolean
get: public read-only
Whether this particular message uses negotiated compression.
getter get
source · line 20get(): Boolean
property isComplete
source · line 24public val isComplete: Boolean
get: public read-only
Whether this body or message reached its successful boundary.
getter get
source · line 24get(): Boolean
function writeFrom
source · line 33public override suspend fun writeFrom(buffer: NativeByteBuffer, count: Long): Long
- Overrides
writeFrom
Accepts up to count readable bytes with bounded frame-sized progress.
parameter buffer
source · line 33buffer: NativeByteBuffer
parameter count
source · line 33count: Long
property isClosed
source · line 28public val isClosed: Boolean
get: public read-only
Whether this body or message has been closed.
getter get
source · line 28get(): Boolean
function finish
source · line 58public suspend fun finish(): Unit
Completes compression if selected and ends the message with FIN.