return true;
}
-void PingScheduler::setup_ping()
-{
- BOOST_ASSERT( 1 <= IpList.get_resolved_ip_count() );
-
- string destination_ip = IpList.get_next_ip();
- bool ping_success = ping( destination_ip );
-
- update_ping_statistics( ping_success );
- update_ping_elapsed_time();
-
- schedule_next_ping();
-}
-
bool PingScheduler::ping( const string &destination_ip ) const
{
BOOST_ASSERT( !destination_ip.empty() );
return pinger.ping( destination_ip );
}
-void PingScheduler::schedule_next_ping()
+void PingScheduler::setup_next_ping()
{
- BOOST_ASSERT( 0 < PingIntervalInSec );
+ BOOST_ASSERT( 1 <= IpList.get_resolved_ip_count() );
- (void) NextPingTimer.expires_from_now( seconds( PingIntervalInSec ) );
- NextPingTimer.async_wait( bind( &PingScheduler::handle_next_ping, this ) );
+ string destination_ip = IpList.get_next_ip();
+ bool ping_success = ping( destination_ip );
+
+ update_ping_statistics( ping_success );
+ update_ping_elapsed_time();
+
+ schedule_next_ping();
}
-void PingScheduler::handle_next_ping()
+void PingScheduler::schedule_next_ping()
{
- setup_ping();
+ BOOST_ASSERT( 0 < PingIntervalInSec );
+
+ (void) NextPingTimer.expires_from_now( seconds( PingIntervalInSec ) );
+ NextPingTimer.async_wait( bind( &PingScheduler::setup_next_ping, this ) );
}
void PingScheduler::update_ping_statistics( const bool ping_success )
private:
bool resolve_ping_address();
- void setup_ping();
bool ping( const std::string &destination_ip ) const;
+ void setup_next_ping();
void schedule_next_ping();
- void handle_next_ping();
void update_ping_statistics( const bool ping_success );
void update_ping_interval();
void update_ping_elapsed_time();