Added a method specially to initialize the pinger object for the first time.
authorGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Sun, 11 Mar 2012 21:21:01 +0000 (18:21 -0300)
committerGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Sun, 11 Mar 2012 21:21:01 +0000 (18:21 -0300)
src/host/pingrotate.cpp
src/host/pingrotate.h

index c8b3433..ab5c671 100644 (file)
@@ -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() )
index e4ad557..22aa076 100644 (file)
@@ -69,6 +69,7 @@ private:
     void set_ping_done_callback( boost::function<void(bool)> 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;