//回收对象节点 public void Recycle(ref QueueNode <ByteData> node) { int nBoundSize = node.item.data.Length; ThreadQueue <ByteData> queueData = null; if (m_dicMemPool.TryGetValue(nBoundSize, out queueData)) { if (queueData.Size() < m_nQueueMaxSize) { queueData.Push(node); } } }
private void RecycleSegmentNode(QueueNode <Segment> node) { //回收data的内存 m_oMemPool.Recycle(ref node.item.data); node.item.data = null; node.next = null; if (null != node) { if (IKCP_MAX_SEGMENT_OBJECT > m_oSegmentPool.Size()) { m_oSegmentPool.Push(node); } } }
//取得当前积压包的数量 public int DataCount() { return(m_oDataQueue.Size()); }