View | Details | Raw Unified | Return to bug 825
Collapse All | Expand All

(-)a/src/applications/udp-client-server/packet-loss-counter.cc (-9 / +6 lines)
 Lines 60-66    Link Here 
60
      delete [] m_receiveBitMap;
60
      delete [] m_receiveBitMap;
61
    }
61
    }
62
  m_receiveBitMap = new uint8_t [m_bitMapSize] ();
62
  m_receiveBitMap = new uint8_t [m_bitMapSize] ();
63
  memset (m_receiveBitMap,1,m_bitMapSize);
63
  memset (m_receiveBitMap,0xFF,m_bitMapSize);
64
}
64
}
65
65
66
uint32_t
66
uint32_t
 Lines 103-119    Link Here 
103
void
103
void
104
PacketLossCounter::NotifyReceived (uint32_t seqNum)
104
PacketLossCounter::NotifyReceived (uint32_t seqNum)
105
{
105
{
106
  if (seqNum>(uint32_t)(m_bitMapSize*8)-1)
106
  for (uint32_t i=m_lastMaxSeqNum+1; i<=seqNum;i++)
107
    {
107
    {
108
      for (uint32_t i=m_lastMaxSeqNum+1; i<=seqNum;i++)
108
      if (GetBit(i)!=1)
109
        {
109
        {
110
          if (GetBit(i)!=1)
110
          NS_LOG_INFO ("Packet lost: " << i-(m_bitMapSize*8));
111
            {
111
          m_lost++;
112
              NS_LOG_INFO ("Packet lost: " << i-(m_bitMapSize*8));
113
              m_lost++;
114
            }
115
          SetBit(i, 0);
116
        }
112
        }
113
      SetBit(i, 0);
117
    }
114
    }
118
  SetBit(seqNum, 1);
115
  SetBit(seqNum, 1);
119
  if (seqNum>m_lastMaxSeqNum)
116
  if (seqNum>m_lastMaxSeqNum)
(-)a/src/applications/udp-client-server/udp-client-server-test.cc (+1 lines)
 Lines 208-213    Link Here 
208
bool PacketLossCounterTestCase::DoRun (void)
208
bool PacketLossCounterTestCase::DoRun (void)
209
{
209
{
210
  PacketLossCounter lossCounter(32);
210
  PacketLossCounter lossCounter(32);
211
  lossCounter.NotifyReceived(32); //out of order
211
  for (uint32_t i=0;i<64;i++)
212
  for (uint32_t i=0;i<64;i++)
212
    {
213
    {
213
      lossCounter.NotifyReceived(i);
214
      lossCounter.NotifyReceived(i);

Return to bug 825