VertexCacheSdk.Comm.MessageCodec (vertexcache_sdk v1.0.0)
View SourceHandles TCP message framing and deframing using VertexCache protocol.
Format:
- 4 bytes big-endian payload length
- 4 bytes big-endian protocol version
- N bytes payload
Summary
Functions
Decodes a framed binary from a given binary stream buffer.
Encodes the given payload as a framed binary.
Functions
Decodes a framed binary from a given binary stream buffer.
Returns
{:ok, payload, rest}
if valid:error
if header is incomplete{:error, reason}
if validation fails
Encodes the given payload as a framed binary.
Raises
ArgumentError
if payload exceeds max size.