Table of Contents

Class CellFrameDecoder

Namespace
KernLab.Cell
Assembly
KernLab.Cell.dll

帧体硬解析门(总体设计 §3.4/§3.6/D5——畸形必报告,绝不静默丢弃): 解码失败给出分类(畸形/未知 tag),报告(事件/计数/断连决策)由调用方承责—— 本类型只保证:解析结果与分类一一对应,没有第三种"悄悄成功/悄悄失败"。

★ 未知 tag 在版本协商后仍出现=UnknownTag;其余一切 解析失败(截断/变长超防御上限/跨成员配对不齐)=MalformedFrame。

public static class CellFrameDecoder
Inheritance
CellFrameDecoder
Inherited Members

Methods

TryDecode(ReadOnlySequence<byte>, out CellFrame?, out CellProtocolError)

硬解析帧体(序列形态——单段直解零拷贝;跨段拷一次入池临时缓冲)。

public static bool TryDecode(ReadOnlySequence<byte> frameBody, out CellFrame? frame, out CellProtocolError error)

Parameters

frameBody ReadOnlySequence<byte>
frame CellFrame
error CellProtocolError

Returns

bool

TryDecode(ReadOnlySpan<byte>, out CellFrame?, out CellProtocolError)

硬解析帧体(span 形态——零拷贝原位可解)。false=协议错误(error 分类)。

public static bool TryDecode(ReadOnlySpan<byte> frameBody, out CellFrame? frame, out CellProtocolError error)

Parameters

frameBody ReadOnlySpan<byte>
frame CellFrame
error CellProtocolError

Returns

bool