Commit 6131f28f authored by Pramod R Sanaga's avatar Pramod R Sanaga
Browse files

Silly mistake - this was causing max delay not to be reported for

some packet losses. I noticed it while going through the vlc run logs today.
The incorrect "if" condition had (packet loss & this packet had max. queue delay) - changed it to (packet loss & report the last seen max. queue delay).

This wasn't affecting the results though - the vlc results still look the same!
parent 1ae1f078
......@@ -10,7 +10,7 @@
using namespace std;
UdpMaxDelaySensor::UdpMaxDelaySensor(UdpPacketSensor const *udpPacketSensorVal, UdpMinDelaySensor const *minDelaySensorVal, UdpLossSensor const *lossSensorVal)
: maxDelay(0),
: maxDelay(0),sentDelay(0),
packetHistory(udpPacketSensorVal),
minDelaySensor(minDelaySensorVal),
lossSensor(lossSensorVal)
......@@ -40,7 +40,6 @@ void UdpMaxDelaySensor::localAck(PacketInfo *packet)
unsigned short int seqNum = *(unsigned short int *)(packet->payload + 1);
unsigned long long oneWayQueueDelay;
bool eventFlag = false;
vector<UdpPacketInfo>::iterator vecIterator;
vector<UdpPacketInfo> ackedPackets = packetHistory->getAckedPackets();
......@@ -86,19 +85,19 @@ void UdpMaxDelaySensor::localAck(PacketInfo *packet)
// Set this as the new maximum one way queuing delay.
if(oneWayQueueDelay > maxDelay)
{
eventFlag = true;
maxDelay = oneWayQueueDelay;
}
// Send an event message to the monitor to change the value of maximum one way delay.
if(eventFlag == true)
if(lossSensor->getPacketLoss() > 0)
{
// Report the maximum delay
ostringstream messageBuffer;
messageBuffer<<"MAXINQ="<<(maxDelay+minDelaySensor->getMinDelay())/1000;
if(lossSensor->getPacketLoss() > 0)
if(maxDelay > sentDelay)
{
messageBuffer<<"MAXINQ="<<(maxDelay+minDelaySensor->getMinDelay())/1000;
global::output->eventMessage(messageBuffer.str(), packet->elab);
sentDelay = maxDelay;
}
logWrite(SENSOR,"VALUE::New Max Delay = %llu",maxDelay);
}
......
......@@ -31,6 +31,7 @@ class UdpMaxDelaySensor:public Sensor{
private:
unsigned long long maxDelay;
unsigned long long sentDelay;
UdpPacketSensor const *packetHistory;
UdpMinDelaySensor const *minDelaySensor;
UdpLossSensor const *lossSensor;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment