Class CellFrameCodec
CellFrame 消息族线编码——[WireMessage] 派生。
public static class CellFrameCodec
- Inheritance
-
CellFrameCodec
- Inherited Members
Fields
TagByeFrame
ByeFrame 的 tag。
public const byte TagByeFrame = 5
Field Value
TagCallbackFrame
CallbackFrame 的 tag。
public const byte TagCallbackFrame = 32
Field Value
TagCallbackResultFrame
CallbackResultFrame 的 tag。
public const byte TagCallbackResultFrame = 33
Field Value
TagCancelFrame
CancelFrame 的 tag。
public const byte TagCancelFrame = 64
Field Value
TagChunkBeginFrame
ChunkBeginFrame 的 tag。
public const byte TagChunkBeginFrame = 18
Field Value
TagChunkDataFrame
ChunkDataFrame 的 tag。
public const byte TagChunkDataFrame = 19
Field Value
TagChunkEndFrame
ChunkEndFrame 的 tag。
public const byte TagChunkEndFrame = 20
Field Value
TagDrainFrame
DrainFrame 的 tag。
public const byte TagDrainFrame = 4
Field Value
TagHelloAckFrame
HelloAckFrame 的 tag。
public const byte TagHelloAckFrame = 2
Field Value
TagHelloFrame
HelloFrame 的 tag。
public const byte TagHelloFrame = 1
Field Value
TagInvokeFrame
InvokeFrame 的 tag。
public const byte TagInvokeFrame = 16
Field Value
TagNotifyFrame
NotifyFrame 的 tag。
public const byte TagNotifyFrame = 80
Field Value
TagReadyFrame
ReadyFrame 的 tag。
public const byte TagReadyFrame = 3
Field Value
TagResultFrame
ResultFrame 的 tag。
public const byte TagResultFrame = 17
Field Value
TagTelemetryBatchFrame
TelemetryBatchFrame 的 tag。
public const byte TagTelemetryBatchFrame = 48
Field Value
Methods
ComputeLength(CellFrame)
总长(单趟遍历——变长成员计数;池化/直写形态的长度预算口)。
public static int ComputeLength(CellFrame message)
Parameters
messageCellFrame
Returns
Encode(CellFrame)
编码(tag 判别 + 根前缀 + 子类字段)。返回新数组。
public static byte[] Encode(CellFrame message)
Parameters
messageCellFrame
Returns
- byte[]
Encode(IBufferWriter<byte>, CellFrame)
编码到 IBufferWriter<T>(零拷贝汇——PipeWriter 直写形态)。
public static void Encode(IBufferWriter<byte> writer, CellFrame message)
Parameters
writerIBufferWriter<byte>messageCellFrame
EncodeInto(Span<byte>, CellFrame)
写入调用方缓冲(零拷贝一等形态——长度须先经 ComputeLength)。
public static void EncodeInto(Span<byte> dest, CellFrame message)
Parameters
EncodePooled(CellFrame, out byte[])
编码到池化租借缓冲(零分配热路径——返回写入长度;缓冲由调用方
ArrayPool<byte>.Shared.Return(rented) 归还。载荷经传输同步拷贝入帧后即可归还)。
public static int EncodePooled(CellFrame message, out byte[] rented)
Parameters
Returns
TryDecode(ReadOnlySpan<byte>, out CellFrame?)
解码(未知 tag/截断/Count 超上限 = false——畸形报文拦截;逐字段防御)。
public static bool TryDecode(ReadOnlySpan<byte> source, out CellFrame? message)
Parameters
sourceReadOnlySpan<byte>messageCellFrame