public class Frame
A frame received or ready to be sent. It is not reusable and not thread-safe
| Modifier and Type | Class and Description |
|---|---|
static class |
Frame.Binary
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.
|
static class |
Frame.Close
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.
|
static class |
Frame.Companion |
static class |
Frame.Ping
Represents a low-level ping frame. Could be sent to test connection (peer should reply with
class Frame.Pong).
Usually there is no need to send/handle it unless you have a RAW web socket session. |
static class |
Frame.Pong
Represents a low-level pong frame. Should be sent in reply to a
class Frame.Ping frame.
Usually there is no need to send/handle it unless you have a RAW web socket session. |
static class |
Frame.Text
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.
|
| Modifier and Type | Field and Description |
|---|---|
static Frame.Companion |
Companion |
| Modifier and Type | Method and Description |
|---|---|
Frame |
copy()
Creates a frame copy
|
java.nio.ByteBuffer |
getBuffer()
a frame content or fragment content
|
kotlinx.coroutines.DisposableHandle |
getDisposableHandle()
could be invoked when the frame is processed
|
boolean |
getFin()
is it final fragment,
|
FrameType |
getFrameType()
enum value
|
java.lang.String |
toString() |
public static Frame.Companion Companion
public java.lang.String toString()
public Frame copy()
Creates a frame copy
public boolean getFin()
is it final fragment,
should be always true for control frames and if no fragmentation is used
public FrameType getFrameType()
enum value
public java.nio.ByteBuffer getBuffer()
a frame content or fragment content
public kotlinx.coroutines.DisposableHandle getDisposableHandle()
could be invoked when the frame is processed