func HandleRequest(hostid int32, reader *packet.Packet, output chan []byte) { defer helper.PrintPanicStack() seqid, err := reader.ReadU64() // read seqid if err != nil { log.Println("Read Sequence Id failed.", err) return } b, err := reader.ReadS16() if err != nil { log.Println("read protocol error") return } handle := ProtoHandler[b] if handle != nil { ret := handle(hostid, reader) if len(ret) != 0 { helper.SendChan(seqid, ret, output) } } }