From: Samuel Lepetit Date: Mon, 2 Jul 2012 09:32:02 +0000 (+0200) Subject: Bugfix in Kademlia example X-Git-Tag: v3_9_90~569^2~19^2~23 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1c28fe550c4da2bc8006f7fd970c78ed3052733a?ds=sidebyside Bugfix in Kademlia example --- diff --git a/examples/kademlia/Node.java b/examples/kademlia/Node.java index cdcc71a071..e8e4e7088f 100644 --- a/examples/kademlia/Node.java +++ b/examples/kademlia/Node.java @@ -182,12 +182,13 @@ public class Node extends Process { int nodesAdded = 0; boolean destinationFound = false; int steps = 0; - double timeBeginReceive = Msg.getClock(); + double timeBeginReceive; double timeout, globalTimeout = Msg.getClock() + Common.FIND_NODE_GLOBAL_TIMEOUT; //Build a list of the closest nodes we already know. Answer nodeList = table.findClosest(destination); Msg.debug("Doing a FIND_NODE on " + destination); do { + timeBeginReceive = Msg.getClock(); answers = 0; queries = this.sendFindNodeToBest(nodeList); totalQueries += queries; @@ -220,14 +221,14 @@ public class Node extends Process { } else { handleTask(task); - timeBeginReceive = Msg.getClock(); timeout += Msg.getClock() - timeBeginReceive; + timeBeginReceive = Msg.getClock(); } } else { handleTask(task); - timeBeginReceive = Msg.getClock(); timeout += Msg.getClock() - timeBeginReceive; + timeBeginReceive = Msg.getClock(); } comm = null; }