FrameDecoder[A: Any val]¶
Wraps any Codec[A] for use with TCP stream framing.
Incoming iso chunks are concatenated with any unconsumed remainder into
a val buffer for decoding. Decoded byte slices are zero-copy views into
that buffer. After the decode loop, the unconsumed tail is kept as a
zero-copy trim for the next call.
InsufficientData means "wait for more bytes" — normal in streaming.
MalformedData means "this data is wrong" — reported as an error via
FrameNotify.frame_error.
Constructors¶
create¶
Parameters¶
- codec: Codec[A] val
Returns¶
- FrameDecoder[A] ref^
Public Functions¶
received¶
Append a chunk of incoming data and extract all complete messages.
Parameters¶
- data: Array[U8 val] iso
- notify: FrameNotify[A] ref
Returns¶
- None val