public final class WebSocketProtocol
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static java.lang.String |
ACCEPT_MAGIC
Magic value which must be appended to the key in a response header.
|
(package private) static int |
B0_FLAG_FIN
Byte 0 flag for whether this is the final fragment in a message.
|
(package private) static int |
B0_FLAG_RSV1
Byte 0 reserved flag 1.
|
(package private) static int |
B0_FLAG_RSV2
Byte 0 reserved flag 2.
|
(package private) static int |
B0_FLAG_RSV3
Byte 0 reserved flag 3.
|
(package private) static int |
B0_MASK_OPCODE
Byte 0 mask for the frame opcode.
|
(package private) static int |
B1_FLAG_MASK
Byte 1 flag for whether the payload data is masked.
|
(package private) static int |
B1_MASK_LENGTH
Byte 1 mask for the payload length.
|
(package private) static int |
CLOSE_CLIENT_GOING_AWAY
Used when an unchecked exception was thrown in a listener.
|
(package private) static long |
CLOSE_MESSAGE_MAX
Maximum length of close message in bytes.
|
(package private) static int |
CLOSE_NO_STATUS_CODE
Used when an empty close frame was received (i.e., without a status code).
|
(package private) static int |
OPCODE_BINARY |
(package private) static int |
OPCODE_CONTINUATION |
(package private) static int |
OPCODE_CONTROL_CLOSE |
(package private) static int |
OPCODE_CONTROL_PING |
(package private) static int |
OPCODE_CONTROL_PONG |
(package private) static int |
OPCODE_FLAG_CONTROL
Flag in the opcode which indicates a control frame.
|
(package private) static int |
OPCODE_TEXT |
(package private) static long |
PAYLOAD_BYTE_MAX
Maximum length of frame payload.
|
(package private) static int |
PAYLOAD_LONG
Value for
B1_MASK_LENGTH which indicates the next eight bytes are the unsigned
length. |
(package private) static int |
PAYLOAD_SHORT
Value for
B1_MASK_LENGTH which indicates the next two bytes are the unsigned length. |
(package private) static long |
PAYLOAD_SHORT_MAX
Maximum length of a frame payload to be denoted as
PAYLOAD_SHORT . |
Modifier | Constructor and Description |
---|---|
private |
WebSocketProtocol() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
acceptHeader(java.lang.String key) |
(package private) static java.lang.String |
closeCodeExceptionMessage(int code) |
(package private) static void |
toggleMask(okio.Buffer.UnsafeCursor cursor,
byte[] key) |
(package private) static void |
validateCloseCode(int code) |
static final java.lang.String ACCEPT_MAGIC
static final int B0_FLAG_FIN
static final int B0_FLAG_RSV1
static final int B0_FLAG_RSV2
static final int B0_FLAG_RSV3
static final int B0_MASK_OPCODE
static final int OPCODE_FLAG_CONTROL
static final int B1_FLAG_MASK
If this flag is set, the next four
bytes represent the mask key. These bytes appear after any additional bytes specified by B1_MASK_LENGTH
.
static final int B1_MASK_LENGTH
If this value is PAYLOAD_SHORT
, the next two
bytes represent the length. If this value is PAYLOAD_LONG
, the next eight bytes
represent the length.
static final int OPCODE_CONTINUATION
static final int OPCODE_TEXT
static final int OPCODE_BINARY
static final int OPCODE_CONTROL_CLOSE
static final int OPCODE_CONTROL_PING
static final int OPCODE_CONTROL_PONG
static final long PAYLOAD_BYTE_MAX
PAYLOAD_SHORT
or PAYLOAD_LONG
.static final long CLOSE_MESSAGE_MAX
static final int PAYLOAD_SHORT
B1_MASK_LENGTH
which indicates the next two bytes are the unsigned length.static final long PAYLOAD_SHORT_MAX
PAYLOAD_SHORT
.static final int PAYLOAD_LONG
B1_MASK_LENGTH
which indicates the next eight bytes are the unsigned
length.static final int CLOSE_CLIENT_GOING_AWAY
static final int CLOSE_NO_STATUS_CODE
static void toggleMask(okio.Buffer.UnsafeCursor cursor, byte[] key)
static java.lang.String closeCodeExceptionMessage(int code)
static void validateCloseCode(int code)
public static java.lang.String acceptHeader(java.lang.String key)