From: Guilherme Maciel Ferreira Date: Sun, 11 Mar 2012 21:21:01 +0000 (-0300) Subject: Added a method specially to initialize the pinger object for the first time. X-Git-Tag: v1.5~1^2~3 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=3eb8c4bd7ecb3cb7729a3167ecb2e30afde57d98;p=pingcheck Added a method specially to initialize the pinger object for the first time. --- diff --git a/src/host/pingrotate.cpp b/src/host/pingrotate.cpp index c8b3433..ab5c671 100644 --- a/src/host/pingrotate.cpp +++ b/src/host/pingrotate.cpp @@ -71,7 +71,7 @@ PingRotate::PingRotate( BOOST_ASSERT( !nameserver.empty() ); BOOST_ASSERT( 0 < protocol_list.size() ); - update_ping_protocol(); + init_ping_protocol(); } /** @@ -130,6 +130,11 @@ void PingRotate::ping_done_handler( bool ping_success ) PingDoneCallback( ping_success ); } +void PingRotate::init_ping_protocol() +{ + get_next_ping_protocol(); +} + void PingRotate::update_ping_protocol() { if ( can_change_ping_protocol() ) diff --git a/src/host/pingrotate.h b/src/host/pingrotate.h index e4ad557..22aa076 100644 --- a/src/host/pingrotate.h +++ b/src/host/pingrotate.h @@ -69,6 +69,7 @@ private: void set_ping_done_callback( boost::function ping_done_callback ); void ping_done_handler( bool ping_success ); + void init_ping_protocol(); void update_ping_protocol(); void get_next_ping_protocol(); bool can_change_ping_protocol() const;