示例#1
0
//向allocResponseQueue写入Packet数据
func (this *ClientHandler) PushAllocResponse(packet *structure.Packet) error {
	if packet == nil {
		err := errors.New("component: Got a nil pointer as the argument")
		fmt.Println(err.Error())
		return err
	}
	this.allocResponseQueue <- packet
	statistics.GetAllocRespQueueCount().Add()
	return nil
}
示例#2
0
//从allocResponseQueue中读取Packet数据
func (this *ClientHandler) AllocResponsePop() *structure.Packet {
	packet := <-this.allocResponseQueue
	statistics.GetAllocRespQueueCount().Dec()
	return packet
}