From c31e0002e20377e48048ca4b8a02118646f35a56 Mon Sep 17 00:00:00 2001 From: Joshua Kissoon Date: Sun, 13 Apr 2014 18:58:40 +0530 Subject: [PATCH] Change the wait time on operations to 50ms --- src/kademlia/core/DefaultConfiguration.java | 2 +- src/kademlia/operation/ConnectOperation.java | 2 +- src/kademlia/operation/ContentLookupOperation.java | 2 +- src/kademlia/operation/NodeLookupOperation.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kademlia/core/DefaultConfiguration.java b/src/kademlia/core/DefaultConfiguration.java index 3a7d66e..f9498ed 100644 --- a/src/kademlia/core/DefaultConfiguration.java +++ b/src/kademlia/core/DefaultConfiguration.java @@ -10,7 +10,7 @@ import java.io.File; public class DefaultConfiguration implements KadConfiguration { - private final static long RESTORE_INTERVAL = 5 * 1000; // Default at 1 hour + private final static long RESTORE_INTERVAL = 60 * 1000; // Default at 1 hour private final static long RESPONSE_TIMEOUT = 1500; private final static long OPERATION_TIMEOUT = 30000; private final static int CONCURRENCY = 10; diff --git a/src/kademlia/operation/ConnectOperation.java b/src/kademlia/operation/ConnectOperation.java index f6b8533..117b875 100644 --- a/src/kademlia/operation/ConnectOperation.java +++ b/src/kademlia/operation/ConnectOperation.java @@ -56,7 +56,7 @@ public class ConnectOperation implements Operation, Receiver /* If we haven't finished as yet, wait for a maximum of config.operationTimeout() time */ int totalTimeWaited = 0; - int timeInterval = 100; // We re-check every 300 milliseconds + int timeInterval = 50; // We re-check every 300 milliseconds while (totalTimeWaited < this.config.operationTimeout()) { if (error) diff --git a/src/kademlia/operation/ContentLookupOperation.java b/src/kademlia/operation/ContentLookupOperation.java index 479fac8..4eac85a 100644 --- a/src/kademlia/operation/ContentLookupOperation.java +++ b/src/kademlia/operation/ContentLookupOperation.java @@ -108,7 +108,7 @@ public class ContentLookupOperation implements Operation, Receiver /* If we haven't finished as yet, wait for a maximum of config.operationTimeout() time */ int totalTimeWaited = 0; - int timeInterval = 100; // We re-check every 300 milliseconds + int timeInterval = 50; // We re-check every 300 milliseconds while (totalTimeWaited < this.config.operationTimeout()) { if (!this.askNodesorFinish()) diff --git a/src/kademlia/operation/NodeLookupOperation.java b/src/kademlia/operation/NodeLookupOperation.java index 474c160..96bbdc4 100644 --- a/src/kademlia/operation/NodeLookupOperation.java +++ b/src/kademlia/operation/NodeLookupOperation.java @@ -99,7 +99,7 @@ public class NodeLookupOperation implements Operation, Receiver /* If we haven't finished as yet, wait for a maximum of config.operationTimeout() time */ int totalTimeWaited = 0; - int timeInterval = 100; // We re-check every 300 milliseconds + int timeInterval = 50; // We re-check every 300 milliseconds while (totalTimeWaited < this.config.operationTimeout()) { if (!this.askNodesorFinish())