WebSocketFrame

A Base Frame as seen in <a href="https://tools.ietf.org/html/rfc6455#section-5.2">RFC 6455. Sec 5.2</a> <p> <pre> 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-------+-+-------------+-------------------------------+ |F|R|R|R| opcode|M| Payload len | Extended payload length | |I|S|S|S| (4) |A| (7) | (16/64) | |N|V|V|V| |S| | (if payload len==126/127) | | |1|2|3| |K| | | +-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - + | Extended payload length continued, if payload len == 127 | + - - - - - - - - - - - - - - - +-------------------------------+ | |Masking-key, if MASK set to 1 | +-------------------------------+-------------------------------+ | Masking-key (continued) | Payload Data | +-------------------------------- - - - - - - - - - - - - - - - + : Payload Data continued ... : + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + | Payload Data continued ... | +---------------------------------------------------------------+ </pre>

Constructors

this
this(byte opcode)

Construct form opcode

Members

Functions

assertValid
void assertValid()
Undocumented in source.
copyHeaders
void copyHeaders(Frame frame)
Undocumented in source. Be warned that the author may not have intended to support it.
copyHeaders
void copyHeaders(WebSocketFrame copy)
Undocumented in source. Be warned that the author may not have intended to support it.
equals
bool equals(Object obj)
Undocumented in source. Be warned that the author may not have intended to support it.
getMask
byte[] getMask()
Undocumented in source. Be warned that the author may not have intended to support it.
getOpCode
byte getOpCode()
Undocumented in source. Be warned that the author may not have intended to support it.
getPayload
ByteBuffer getPayload()

Get the payload ByteBuffer. possible null.

getPayloadAsUTF8
string getPayloadAsUTF8()
Undocumented in source. Be warned that the author may not have intended to support it.
getPayloadLength
int getPayloadLength()
Undocumented in source. Be warned that the author may not have intended to support it.
getType
Type getType()
Undocumented in source. Be warned that the author may not have intended to support it.
hasPayload
bool hasPayload()
Undocumented in source. Be warned that the author may not have intended to support it.
hashCode
size_t hashCode()
Undocumented in source. Be warned that the author may not have intended to support it.
isControlFrame
bool isControlFrame()
Undocumented in source.
isDataFrame
bool isDataFrame()
Undocumented in source.
isFin
bool isFin()
Undocumented in source. Be warned that the author may not have intended to support it.
isMasked
bool isMasked()
Undocumented in source. Be warned that the author may not have intended to support it.
isRsv1
bool isRsv1()
Undocumented in source. Be warned that the author may not have intended to support it.
isRsv2
bool isRsv2()
Undocumented in source. Be warned that the author may not have intended to support it.
isRsv3
bool isRsv3()
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Object obj)
Undocumented in source. Be warned that the author may not have intended to support it.
reset
void reset()
Undocumented in source. Be warned that the author may not have intended to support it.
setFin
WebSocketFrame setFin(bool fin)
Undocumented in source. Be warned that the author may not have intended to support it.
setMask
Frame setMask(byte[] maskingKey)
Undocumented in source. Be warned that the author may not have intended to support it.
setMasked
Frame setMasked(bool mask)
Undocumented in source. Be warned that the author may not have intended to support it.
setOpCode
WebSocketFrame setOpCode(byte op)
Undocumented in source. Be warned that the author may not have intended to support it.
setPayload
WebSocketFrame setPayload(ByteBuffer buf)

Set the data payload. <p> The provided buffer will be used as is, no copying of bytes performed. <p> The provided buffer should be flipped and ready to READ from.

setRsv1
WebSocketFrame setRsv1(bool rsv1)
Undocumented in source. Be warned that the author may not have intended to support it.
setRsv2
WebSocketFrame setRsv2(bool rsv2)
Undocumented in source. Be warned that the author may not have intended to support it.
setRsv3
WebSocketFrame setRsv3(bool rsv3)
Undocumented in source. Be warned that the author may not have intended to support it.
toHash
size_t toHash()
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

data
ByteBuffer data;

The payload data. <p> It is assumed to always be in FLUSH mode (ready to read) in this object.

finRsvOp
byte finRsvOp;

Combined FIN + RSV1 + RSV2 + RSV3 + OpCode byte. <p> <pre> 1000_0000 (0x80) = fin 0100_0000 (0x40) = rsv1 0010_0000 (0x20) = rsv2 0001_0000 (0x10) = rsv3 0000_1111 (0x0F) = opcode </pre>

mask
byte[] mask;
Undocumented in source.
masked
bool masked;
Undocumented in source.

Inherited Members

From Frame

Type
enum Type
Undocumented in source.
getMask
byte[] getMask()
Undocumented in source.
getOpCode
byte getOpCode()
Undocumented in source.
getPayload
ByteBuffer getPayload()
Undocumented in source.
getPayloadLength
int getPayloadLength()

The original payload length ({@link ByteBuffer#remaining()})

getType
Type getType()
Undocumented in source.
hasPayload
bool hasPayload()
Undocumented in source.
isFin
bool isFin()
Undocumented in source.
isMasked
bool isMasked()
Undocumented in source.
isRsv1
bool isRsv1()
Undocumented in source.
isRsv2
bool isRsv2()
Undocumented in source.
isRsv3
bool isRsv3()
Undocumented in source.

Meta