FIX.Session.Framing (fix_session v0.1.2)

Copy Markdown View Source

Drains complete FIX messages from an accumulated byte buffer.

Pure: repeatedly applies FIX.Message.parse/2 to the front of the buffer until it hits an incomplete tail, which the caller keeps and prepends to the next socket read. Framing, BodyLength(9), and CheckSum(10) errors are returned as-is; the caller decides how to fail the session.

Summary

Functions

drain(buffer, dictionary)

@spec drain(binary(), module()) ::
  {:ok, [FIX.Message.t()], rest :: binary()}
  | {:error, FIX.Parser.frame_error()}