]> sjero.net Git - iperf/commitdiff
Support for continuous runs
authorIan McDonald <ian.mcdonald@jandi.co.nz>
Tue, 24 Feb 2009 19:43:12 +0000 (20:43 +0100)
committerGerrit Renker <gerrit@erg.abdn.ac.uk>
Tue, 24 Feb 2009 19:43:12 +0000 (20:43 +0100)
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
src/Locale.c

index b1dda9c2e99b592cd0bb834a292b1da35e392a21..6a64991680340cae8374e202a53fc89b3702bad5 100644 (file)
@@ -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 ) ) {
index 838783261fc8fcf0d02b0f60b03dffd39b7b821e..ade47f07c605c18ea01f3ce78f2851f039f0c08d 100644 (file)
@@ -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 <name>   input the data to be transmitted from a file\n\
   -I, --stdin              input the data to be transmitted from stdin\n\