Skip to content

Commit

Permalink
threaded CLI traffic generator requires at least Qt 5.10
Browse files Browse the repository at this point in the history
  • Loading branch information
dannagle committed Aug 20, 2023
1 parent d94267b commit b6f0cad
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,15 @@ int main(int argc, char *argv[])

if(maxrate) {
OUTIF() << "Max rate traffic generator will use separate sockets per thread";


// Threaded traffic generator requires at least Qt 5.10 (which the AppImage does not use yet)
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
QUdpSocket sock;
QTextStream out(stdout);
intenseTrafficGenerator(out, sock, addy, port, dataString, bps, rate, stopnum, usdelay);
#else

QList<QThread *> threadedTraffic;
int max_threads = QThread::idealThreadCount();
for(int thread_i = 0; thread_i < max_threads; thread_i++ ) {
Expand All @@ -986,6 +995,9 @@ int main(int argc, char *argv[])
QThread::sleep(1);
}


#endif

} else {
int done = intenseTrafficGenerator(out, sock, addy, port, dataString, bps, rate, stopnum, usdelay);
return done;
Expand Down

0 comments on commit b6f0cad

Please sign in to comment.