class WebSocketFrameEncoder
source · line 15public class WebSocketFrameEncoder public constructor(
/**
* The endpoint role determining incoming/outgoing masking requirements.
*/
public val role: HttpRole, compressionEnabled: Boolean = false) : Closeable
- Supertype
Closeable - Inherited
fun dispose(): Unit· Closeable
A serial in-memory frame encoder with explicit begin/write/finish. Client frames receive fresh masking keys; it does not perform compression or transport I/O.
function finishFrame
source · line 87public fun finishFrame(): Unit
Requires exactly the declared payload length and validates control/message completion; emits no additional bytes.
function beginFrame
source · line 50public fun beginFrame(head: WebSocketFrameHead): Array<Byte>
Validates sequencing and returns the frame header, including a fresh client masking key when required.
parameter head
source · line 50head: WebSocketFrameHead
property isMessageOpen
source · line 36public val isMessageOpen: Boolean
get: public read-only
Whether a fragmented data message is in progress.
getter get
source · line 36get(): Boolean
property hasCloseFrame
source · line 40public val hasCloseFrame: Boolean
get: public read-only
Whether a close frame has been processed.
getter get
source · line 40get(): Boolean
property isClosed
source · line 28public val isClosed: Boolean
get: public read-only
Whether local frame state has been closed.
getter get
source · line 28get(): Boolean
function writePayload
source · line 65public fun writePayload(buffer: NativeByteBuffer, count: Long = buffer.readableBytes): Array<Byte>
Consumes payload bytes and returns their masked or unmasked wire form, preserving mask position across chunks.
parameter buffer
source · line 65buffer: NativeByteBuffer
parameter count
source · line 65count: Long = buffer.readableBytes
property isFrameOpen
source · line 32public val isFrameOpen: Boolean
get: public read-only
Whether a frame still requires payload bytes and finishFrame.
getter get
source · line 32get(): Boolean
property failure
source · line 44public val failure: Throwable?
get: public read-only
The retained framing or message failure.
getter get
source · line 44get(): Option<Throwable>
constructor constructor
source · line 15constructor(public val role: HttpRole, compressionEnabled: Boolean = false)
parameter compressionEnabled
source · line 19compressionEnabled: Boolean = false
parameter role
source · line 19public val role: HttpRole
function close
source · line 106public override fun close(): Unit
- Overrides
close
Releases local state; it does not send a Close frame or close a transport.
property role
source · line 19public val role: HttpRole
get: public read-only
The endpoint role determining incoming/outgoing masking requirements.