Skip to main content

Module protobuf_decoder

Module protobuf_decoder 

Source
Expand description

§安全的 Protobuf 解码器(含粘包处理)

用于处理带长度前缀的 Protobuf 消息,防止将 varint 长度前缀误认为字符串内容 这解决了 protobuf string 字段前出现 “\x0c” 的问题,该问题是由于 length varint 被当成字符串解码导致的

此模块提供了专门的 Protobuf 序列化器实现,以替代基础的 ProtobufSerializer

Structs§

ProtobufDecoder
Protobuf 消息解码器,支持粘包处理

Functions§

safe_protobuf_decode
安全的 protobuf 消息内容解码函数
safe_string_decode
安全的字符串解码函数(用于调试目的)