public void Push(NetworkInfo msg, ref LinkMsg pCurLink) { msgList[count] = msg; count++; if (count >= msgList.Length) { this.next = new LinkMsg(); pCurLink = this.next; } }
public void Clear() { for (NetworkInfo msg = this.Pop(); msg != null; msg = this.Pop()) { if (msg.buffer != null) { msg.buffer.Close(); } } this.writeMsg = new LinkMsg(); this.readMsg = this.writeMsg; }
public NetworkInfo Read(ref LinkMsg pCurLink) { NetworkInfo msg = null; if (count > pos) { msg = msgList[pos]; msgList[pos] = null; pos++; } else if (this.next != null) { pCurLink = this.next; LinkMsg.Listcount++; msgList = null; this.next = null; return(pCurLink.Read(ref pCurLink)); } return(msg); }