Generator

Generating a frame in WebSocket land. <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(WebSocketPolicy policy)

Construct Generator with provided policy and bufferPool

this
this(WebSocketPolicy policy, bool validating)

Construct Generator with provided policy and bufferPool

this
this(WebSocketPolicy policy, bool validating, bool readOnly)

Construct Generator with provided policy and bufferPool

Members

Functions

assertFrameValid
void assertFrameValid(WebSocketFrame frame)
Undocumented in source. Be warned that the author may not have intended to support it.
configureFromExtensions
void configureFromExtensions(Extension[] exts)
Undocumented in source. Be warned that the author may not have intended to support it.
generateHeaderBytes
ByteBuffer generateHeaderBytes(WebSocketFrame frame)
Undocumented in source. Be warned that the author may not have intended to support it.
generateHeaderBytes
void generateHeaderBytes(WebSocketFrame frame, ByteBuffer buffer)
Undocumented in source. Be warned that the author may not have intended to support it.
generateWholeFrame
void generateWholeFrame(WebSocketFrame frame, ByteBuffer buf)

Generate the whole frame (header + payload copy) into a single ByteBuffer. <p> Note: This is slow, moves lots of memory around. Only use this if you must (such as in unit testing).

isRsv1InUse
bool isRsv1InUse()
Undocumented in source. Be warned that the author may not have intended to support it.
isRsv2InUse
bool isRsv2InUse()
Undocumented in source. Be warned that the author may not have intended to support it.
isRsv3InUse
bool isRsv3InUse()
Undocumented in source. Be warned that the author may not have intended to support it.
setRsv1InUse
void setRsv1InUse(bool rsv1InUse)
Undocumented in source. Be warned that the author may not have intended to support it.
setRsv2InUse
void setRsv2InUse(bool rsv2InUse)
Undocumented in source. Be warned that the author may not have intended to support it.
setRsv3InUse
void setRsv3InUse(bool rsv3InUse)
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

MAX_HEADER_LENGTH
enum int MAX_HEADER_LENGTH;

The overhead (maximum) for a framing header. Assuming a maximum sized payload with masking key.

Meta