diff --git a/APRSISClient.cpp b/APRSISClient.cpp index 7b43dbb..d0b587e 100644 --- a/APRSISClient.cpp +++ b/APRSISClient.cpp @@ -260,6 +260,12 @@ void APRSISClient::processQueue(bool disconnect){ auto frame = pair.first; auto timestamp = pair.second; + // random delay 50% of the time for throttling (a skip will add 60 seconds to the processing time) + if(qrand() % 100 <= 50){ + qDebug() << "APRSISClient Throttle: Skipping Frame"; + continue; + } + // if the packet is older than the timeout, drop it. if(timestamp.secsTo(QDateTime::currentDateTimeUtc()) > PACKET_TIMEOUT_SECONDS){ qDebug() << "APRSISClient Packet Timeout:" << frame; diff --git a/APRSISClient.h b/APRSISClient.h index 3e7a59e..bdad128 100644 --- a/APRSISClient.h +++ b/APRSISClient.h @@ -1,6 +1,7 @@ #ifndef APRSISCLIENT_H #define APRSISCLIENT_H +#include #include #include #include