heguanfeng
Results
1
comments of
heguanfeng
protobuf 的协议头不一样,需要增加两个字节的MSG_ID,上行下行协议一致 len+msgId+pbdata,其中len=2+len(pbdata) 这里面服务器的消息注册有点问题,MSG_ID是与服务器端注册函数(p *Processor) Register(msg proto.Message)的调用次序有关的 `func (p *Processor) Register(msg proto.Message) uint16 { msgType := reflect.TypeOf(msg) if msgType == nil || msgType.Kind() != reflect.Ptr { log.Fatal("protobuf message pointer required")...