diff --git a/examples/wireless/wifi-backward-compatibility.cc b/examples/wireless/wifi-backward-compatibility.cc index ec1a28716..d14ef3ec0 100644 --- a/examples/wireless/wifi-backward-compatibility.cc +++ b/examples/wireless/wifi-backward-compatibility.cc @@ -217,22 +217,31 @@ int main (int argc, char *argv[]) uint64_t rxBytes; double throughput; + bool error = false; if (apHasTraffic) { rxBytes = payloadSize * DynamicCast (staServerApp.Get (0))->GetReceived (); throughput = (rxBytes * 8) / (simulationTime * 1000000.0); //Mbit/s std::cout << "AP Throughput: " << throughput << " Mbit/s" << std::endl; + if (throughput == 0) + { + error = true; + } } if (staHasTraffic) { rxBytes = payloadSize * DynamicCast (apServerApp.Get (0))->GetReceived (); throughput = (rxBytes * 8) / (simulationTime * 1000000.0); //Mbit/s std::cout << "STA Throughput: " << throughput << " Mbit/s" << std::endl; + if (throughput == 0) + { + error = true; + } } Simulator::Destroy (); - if (throughput == 0) + if (error) { NS_LOG_ERROR ("No traffic received!"); exit (1);