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

Function SetDictionary

conn/message/message.go:149–172  ·  view source on GitHub ↗

启用路由压缩 对于服务端,server会扫描所有的Handler信息 对于客户端,用户需要配置一个路由映射表 通过这两种方式,pitaya会拿到所有的客户端和服务端的路由信息,然后将每一个路由信息都映射为一个小整数, 在客户端与服务器建立连接的握手过程中,服务器会将 整个字典传给客户端, 这样在以后的通信中,对于路由信息,将全部使用定义的小整数进行标记,大大地减少了额外信 息开销 SetDictionary set routes map which be used to compress route.

(dict map[string]uint16)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 5

SetDictionaryFunction · 0.92
TestEncodeFunction · 0.70
TestDecodeFunction · 0.70
TestSetDictionatyFunction · 0.70

Calls 1

ErrorfMethod · 0.80

Tested by 3

TestEncodeFunction · 0.56
TestDecodeFunction · 0.56
TestSetDictionatyFunction · 0.56