Beispiel #1
0
        /**
         * read (but NOT remove) the first entry in the loss list
         * @return
         */
        public ReceiverLossListEntry getFirstEntry()
        {
            ReceiverLossListEntry item = null;

            backingList.TryDequeue(out item);
            return(item);
        }
Beispiel #2
0
 public void Insert(ReceiverLossListEntry entry)
 {
     lock (backingList) {
         if (!keys.ContainsKey(entry))
         {
             backingList.Enqueue(entry);
             keys[entry] = null;
         }
     }
 }
Beispiel #3
0
        /**
         * return all sequence numbers whose last feedback time is larger than k*RTT
         *
         * @param RTT - the current round trip time
         * @param doFeedback - true if the k parameter should be increased and the time should
         * be reset (using {@link ReceiverLossListEntry#feedback()} )
         * @return
         */
        public List <long> getFilteredSequenceNumbers(long RTT, bool doFeedback)
        {
            List <long> result = new List <long>();

            ReceiverLossListEntry[] sorted = new ReceiverLossListEntry[backingList.Count];
            backingList.CopyTo(sorted, 0);
            Array.Sort(sorted);
            foreach (ReceiverLossListEntry e in sorted)
            {
                if ((Util.getCurrentTime() - e.getLastFeedbackTime()) > e.getK() * RTT)
                {
                    result.Add(e.GetSequenceNumber());
                    if (doFeedback)
                    {
                        e.Feedback();
                    }
                }
            }
            return(result);
        }
Beispiel #4
0
 public bool Contains(ReceiverLossListEntry obj)
 {
     // return backingList.contains(obj);
     return(keys.ContainsKey(obj));
 }