allow sending ASAP and remove any artificial delays

This commit is contained in:
jrandom
2004-06-27 20:53:32 +00:00
committed by zzz
parent 5c1e001a73
commit 349e80f206
2 changed files with 8 additions and 5 deletions

View File

@ -358,7 +358,7 @@ public class ClientConfig {
int sendFreq = getInt(sendFrequencyVal); int sendFreq = getInt(sendFrequencyVal);
int sendSize = getInt(sendSizeVal); int sendSize = getInt(sendSizeVal);
if ((duration <= 0) || (statFreq <= 0) || (sendFreq <= 0) || (sendSize <= 0)) { if ((duration <= 0) || (statFreq <= 0) || (sendFreq < 0) || (sendSize <= 0)) {
if (_log.shouldLog(Log.WARN)) { if (_log.shouldLog(Log.WARN)) {
_log.warn("Invalid client config: duration [" + statDurationVal + "] stat frequency [" _log.warn("Invalid client config: duration [" + statDurationVal + "] stat frequency ["
+ statFrequencyVal + "] send frequency [" + sendFrequencyVal + "] send size [" + statFrequencyVal + "] send frequency [" + sendFrequencyVal + "] send size ["
@ -424,7 +424,7 @@ public class ClientConfig {
* @return true if it was stored correctly, false if there were errors * @return true if it was stored correctly, false if there were errors
*/ */
public boolean store(Properties clientConfig, int peerNum) { public boolean store(Properties clientConfig, int peerNum) {
if ((_peer == null) || (_sendFrequency <= 0) || (_sendSize <= 0) || (_statDuration <= 0) if ((_peer == null) || (_sendFrequency < 0) || (_sendSize <= 0) || (_statDuration <= 0)
|| (_statFrequency <= 0) || (_statFile == null)) { return false; } || (_statFrequency <= 0) || (_statFile == null)) { return false; }
String comment = _comment; String comment = _comment;

View File

@ -120,11 +120,14 @@ class ClientEngine {
_data.cleanup(); _data.cleanup();
long timeToWait = nextSend - Clock.getInstance().now();
if (timeToWait > 0) {
try { try {
Thread.sleep(1000); Thread.sleep(timeToWait);
} catch (InterruptedException ie) { } catch (InterruptedException ie) {
} }
} }
} }
} }
}
} }