VertexCacheSdk.Comm.MessageCodec (vertexcache_sdk v1.0.0)

View Source

Handles 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

read_framed_message(arg1)

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

write_framed_message(payload, client_option)

Encodes the given payload as a framed binary.

Raises