Determine the total packet length based on received data in a buffer.
If the length cannot be determined with the data provided, then report the number of additional bytes that must be read before a determination may be made.
This callback must not be NULL.
- Parameters
-
handler | The TransportHandler that is asking about the size. This must not be NULL. |
buffer | The data that comprises the (possibly partial) packet. This may be NULL if length is zero. |
offset | The offset to the first byte of the PDU. This value is ignored if length is zero. |
length | The amount of data past the offset, which may be zero. |
- Returns
- A negative number to indicate that more data must be read (the absolute value number of additional bytes should be read), or a positive number to indicate the actual (total) length of the PDU, or zero to indicate a catastrophic, unrecoverable error.