added option min-time-between-resolves-option and tests for it
[pingcheck] / src / config / configuration.cpp
index 48971fd..c030e81 100644 (file)
@@ -62,6 +62,7 @@ Configuration::Configuration() :
     PingReplyTimeout( 30 ),
     MaxAddressResolutionAttempts( 10 ),
     ResolvedIpTtlThreshold( 10 ),
+    MinTimeBetweenResolves( 10 ),
     DnsCacheFile(""),
     Hosts(),
     RatioRandomHosts( 1.0f ),
@@ -248,6 +249,16 @@ void Configuration::set_resolved_ip_ttl_threshold( const int resolved_ip_ttl_thr
     ResolvedIpTtlThreshold = resolved_ip_ttl_threshold;
 }
 
+int Configuration::get_min_time_between_resolves() const
+{
+    return MinTimeBetweenResolves;
+}
+void Configuration::set_min_time_between_resolves( const int min_time_between_resolves )
+{
+    BOOST_ASSERT(min_time_between_resolves >= 0 );
+    MinTimeBetweenResolves = min_time_between_resolves;
+}
+
 void Configuration::set_dns_cache_file( const std::string &dns_cache_file)
 {
     BOOST_ASSERT( !dns_cache_file.empty() );