MCPcopy Create free account
hub / github.com/bytemode/pitaya-notes / Encode

Method Encode

conn/message/message_encoder.go:71–136  ·  view source on GitHub ↗

message编码方式 消息头 ----------flag(1byte) --------------------------------------------------->message id(0~5byte)------>route(0~256byte) preserved(3bit) + 1bit(gzip) + message type(3bit) + route zip flag(1bit) 变长编码 2byte的route code或1bite长度字符串 数据部分 根据是否启用gzip压缩在flag的第5个bit写标志,之后再消息头之后添加

(message *Message)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 5

TestEncodeFunction · 0.95
TestAgentWriteChSendFunction · 0.95

Calls 3

DeflateDataFunction · 0.92
invalidTypeFunction · 0.85
routableFunction · 0.85

Tested by 5

TestEncodeFunction · 0.76
TestAgentWriteChSendFunction · 0.76