private ACKInfo GetAckInfo() { ACKInfo result; if (this.mBackACKInfo.Count > 0) { ACKInfo aCKInfo = this.mBackACKInfo[0]; this.mBackACKInfo.RemoveAt(0); result = aCKInfo; } else { result = new ACKInfo(); } return(result); }
public void OnRecv(object obj) { OperationResponse operationResponse = obj as OperationResponse; int channelID = (int)operationResponse.Parameters[1]; int seqNo = (int)operationResponse.Parameters[2]; lock (this.channelDict) { CustomClientReliableChannel channel = this.GetChannel(channelID); if (operationResponse.OperationCode != 240) { ACKInfo ackInfo = this.GetAckInfo(); ackInfo.channelID = channelID; ackInfo.seqNo = seqNo; ackInfo.code = (PvpCode)operationResponse.OperationCode; channel.mACKInfo.Add(ackInfo); } channel.OnRecv(seqNo, operationResponse); } }
private void ReleaseAckInfo(ACKInfo info) { this.mBackACKInfo.Add(info); }