static void timer_Tick(object sender, EventArgs e)
 {
     byte[] recvData;
     for (int i = 0; i < 100; i++)
     {
         if (ReplyQueue.Count > 0)
         {
             recvData = ReplyQueue.Dequeue();
             MemoryManager.DecodeResponse(recvData);
         }
         else
         {
             break;
         }
     }
 }
Exemplo n.º 2
0
        public void Add(ICMPReply newReply)
        {
            log.Debug("Adding new reply");
            ReplyQueue.Enqueue(newReply);

            if (ReplyQueue.Count > MaxLength)
            {
                log.Debug("Reply queue to large. Dequeueing oldest item");
                ReplyQueue.Dequeue();
            }

            log.Debug("Queue size [" + ReplyQueue.Count + "]");

            ComputeStatistics();
            log.Debug("Completed Add");
        }