PayloadStack(buffer, payloadFactory)
Stacking payloads in a buffer. When you recieve a message through the
network, it's added to the stack. As mesages can come in partial chunks,
they need to be buffered until we have recieved the complete message.
Messages can also be recieved in a batch of multiple messages, requiring an
instance to segregate the message stack.
Parameters:
| Name |
Type |
Description |
buffer |
Buffer
|
initial buffer |
payloadFactory |
PayloadFactory
|
|
Methods
-
-
Adds a buffer to the stack
Parameters:
| Name |
Type |
Attributes |
Description |
buffer |
Buffer
|
<repeatable>
|
buffers to add to the stack |
-
-
Attempts to cut out the first message of the stack
Throws:
-
ERR_OUT_OF_RANGE
-
ERR_INCOMPLETE_MESSAGE