Frame
sealed expect class Frame
A frame received or ready to be sent. It is not reusable and not thread-safe
Types
class Binary : Frame Represents an application level binary 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). Note that usually there is no need to handle fragments unless you have a RAW web socket session. |
|
class Close : Frame Represents a low-level level close frame. It could be sent to indicate web socket session end. Usually there is no need to send/handle it unless you have a RAW web socket session. |
|
class Ping : Frame Represents a low-level ping frame. Could be sent to test connection (peer should reply with Pong). Usually there is no need to send/handle it unless you have a RAW web socket session. |
|
class Pong : Frame Represents a low-level pong frame. Should be sent in reply to a Ping frame. Usually there is no need to send/handle it unless you have a RAW web socket session. |
|
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. |
Properties
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 |
Functions
fun copy(): Frame Creates a frame copy |
|
open fun toString(): String |
Companion Object Functions
fun byType( Create a particular Frame instance by frame type |
Extension Functions
Read binary content from a frame. For fragmented frames only returns this fragment. |
Inheritors
class Binary : Frame Represents an application level binary 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). Note that usually there is no need to handle fragments unless you have a RAW web socket session. |
|
class Close : Frame Represents a low-level level close frame. It could be sent to indicate web socket session end. Usually there is no need to send/handle it unless you have a RAW web socket session. |
|
class Ping : Frame Represents a low-level ping frame. Could be sent to test connection (peer should reply with Pong). Usually there is no need to send/handle it unless you have a RAW web socket session. |
|
class Pong : Frame Represents a low-level pong frame. Should be sent in reply to a Ping frame. Usually there is no need to send/handle it unless you have a RAW web socket session. |
|
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. |