);
}
-void IcmpPinger::start_receive()
-{
- // Discard any data already in the buffer.
- ReplyBuffer.consume( ReplyBuffer.size() );
-
- // Waiting for a reply. We prepare the buffer to receive up to 64KB.
- Socket.async_receive(
- ReplyBuffer.prepare( 65536 ),
- boost::bind( &IcmpPinger::handle_receive_icmp_packet, this, _2 )
- );
-}
-
/**
* @brief Gets called when the ping is finished: Either on timeout or on ping reply
*
PingDoneCallback(ping_success);
}
+void IcmpPinger::start_receive()
+{
+ // Discard any data already in the buffer.
+ ReplyBuffer.consume( ReplyBuffer.size() );
+
+ // Waiting for a reply. We prepare the buffer to receive up to 64KB.
+ Socket.async_receive(
+ ReplyBuffer.prepare( 65536 ),
+ boost::bind( &IcmpPinger::handle_receive_icmp_packet, this, _2 )
+ );
+}
+
/**
* @brief Receive ICMP packets
* Note: Will receive -all- ICMP packets from the kernel. So if the packet doesn't match
IcmpPacket create_echo_request( const uint16_t sequence_number ) const;
void send_echo_request( const IcmpPacket &icmp_packet );
void schedule_timeout_echo_reply();
+ void handle_ping_done();
void start_receive();
void handle_receive_icmp_packet( const std::size_t &bytes_transferred );
- void handle_ping_done();
void print_echo_reply(
const IcmpPacket &icmp_packet,