class Text : Frame
Represents an application level text frame. In a RAW web socket session a big text frame could be fragmented (separated into several text frames so they have fin = false except the last one). Please note that a boundary between fragments could be in the middle of multi-byte (unicode) character so don't apply String constructor to every fragment but use decoder loop instead of concatenate fragments first. Note that usually there is no need to handle fragments unless you have a RAW web socket session.
Text(fin: Boolean, data: ByteArray) Text(text: String) Text(fin: Boolean, packet: ByteReadPacket) Text(fin: Boolean, buffer: ByteBuffer) Text(fin: Boolean, data: ByteArray, rsv1: Boolean = false, rsv2: Boolean = false, rsv3: Boolean = false)
Represents an application level text frame. In a RAW web socket session a big text frame could be fragmented (separated into several text frames so they have fin = false except the last one). Please note that a boundary between fragments could be in the middle of multi-byte (unicode) character so don't apply String constructor to every fragment but use decoder loop instead of concatenate fragments first. Note that usually there is no need to handle fragments unless you have a RAW web socket session. |
val buffer: ByteBuffer
Frame content |
|
val data: ByteArray
|
|
val disposableHandle: DisposableHandle
could be invoked when the frame is processed |
|
val fin: Boolean
is it final fragment, should be always |
|
val frameType: FrameType
enum value |
|
val rsv1: Boolean
First extension bit. |
|
val rsv2: Boolean
Second extension bit. |
|
val rsv3: Boolean
Third extension bit. |
fun copy(): Frame
Creates a frame copy |
|
open fun toString(): String |
fun Text.readText(): String
Read text content from text frame. Shouldn't be used for fragmented frames: such frames need to be reassembled first |