From 45b167d420c535f754203fbce29a893b0ca0aae2 Mon Sep 17 00:00:00 2001 From: Ian McDonald Date: Tue, 24 Feb 2009 20:43:12 +0100 Subject: [PATCH] Support for continuous runs This patch makes iperf run continuously if -t 0 is used as a parameter. (Well it makes it run for 7 years which is long enough for my needs) --- src/Client.cpp | 5 ++++- src/Locale.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Client.cpp b/src/Client.cpp index b1dda9c..6a64991 100644 --- a/src/Client.cpp +++ b/src/Client.cpp @@ -129,7 +129,10 @@ void Client::Run( void ) { // setup termination variables if ( mMode_Time ) { mEndTime.setnow(); - mEndTime.add( mSettings->mAmount / 100.0 ); + if (mSettings->mAmount == 0) + mEndTime.add(2209032.0); // 7 years - i.e. continuous + else + mEndTime.add(mSettings->mAmount / 100.0); } if ( isPacketOriented( mSettings ) ) { diff --git a/src/Locale.c b/src/Locale.c index 8387832..ade47f0 100644 --- a/src/Locale.c +++ b/src/Locale.c @@ -100,6 +100,7 @@ Client specific:\n\ -2, --dualtest Do a bidirectional test simultaneously\n\ -r, --tradeoff Do a bidirectional test individually\n\ -t, --time # time in seconds to transmit for (default 10 secs)\n\ + or 0 for continuous\n\ -n, --num #[KM] number of bytes to transmit (instead of -t)\n\ -F, --fileinput input the data to be transmitted from a file\n\ -I, --stdin input the data to be transmitted from stdin\n\ -- 2.39.2