#include "host/pingrotate.h"
+#include <algorithm>
+
#include <boost/assert.hpp>
#include <boost/bind.hpp>
{
PingDoneCallback( ping_success );
+ update_ping_protocol();
+}
+
+void PingRotate::update_ping_protocol()
+{
if ( can_change_ping_protocol() )
{
get_next_ping_protocol();
{
PingProtocol ping_protocol = ProtocolList.front();
- ProtocolList.pop_front();
- ProtocolList.push_back( ping_protocol );
+ rotate( ProtocolList.begin(), ++ProtocolList.begin(), ProtocolList.end() );
Ping = PingerFactory::createPinger( ping_protocol, IoService, NetworkInterfaceName );
}
//
void ping_done_handler( bool ping_success );
+ void update_ping_protocol();
void get_next_ping_protocol();
bool can_change_ping_protocol() const;