ndncatchunks: Reduce initial timeout of iterative version discovery
Reduce the default timeout to 300ms.
Provide a parameter '--discovery-timeout' to raise it, if necessary.
Reduce the number of timeouts for version discovery from 2 to 1.
refs: #4291
Change-Id: I459645ab074ed9b15a74baed39f45903fcb31ff1
diff --git a/tools/chunks/catchunks/discover-version-iterative.hpp b/tools/chunks/catchunks/discover-version-iterative.hpp
index 8beb2fb..59652a6 100644
--- a/tools/chunks/catchunks/discover-version-iterative.hpp
+++ b/tools/chunks/catchunks/discover-version-iterative.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2016, Regents of the University of California,
+/*
+ * Copyright (c) 2016-2017, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -23,6 +23,7 @@
* @author Wentao Shang
* @author Steve DiBenedetto
* @author Andrea Tosatto
+ * @author Klaus Schneider
*/
#ifndef NDN_TOOLS_CHUNKS_CATCHUNKS_DISCOVER_VERSION_ITERATIVE_HPP
@@ -44,12 +45,14 @@
explicit
DiscoverVersionIterativeOptions(const Options& opt = Options())
: Options(opt)
- , maxRetriesAfterVersionFound(1)
+ , maxRetriesAfterVersionFound(0)
+ , discoveryTimeout(time::milliseconds(300))
{
}
public:
- int maxRetriesAfterVersionFound; // used only in timeout handling
+ int maxRetriesAfterVersionFound; // how many times to retry after a discoveryTimeout
+ time::milliseconds discoveryTimeout; // timeout for version discovery
};
/**