ReplyBuffer(),
RepliesCount( 0 ),
TimesToPingTotal( 0 ),
- MinTimesToPing( 0 ),
+ MinTimesToPing( 1 ),
MaxTimesToPing( numeric_limits<uint>::max() )
{
}
)
{
BOOST_ASSERT( !destination.empty() );
- BOOST_ASSERT( ( MinTimesToPing < times_to_ping ) && ( times_to_ping < MaxTimesToPing ) );
+ BOOST_ASSERT( ( MinTimesToPing <= times_to_ping ) && ( times_to_ping <= MaxTimesToPing ) );
icmp::resolver::query query( icmp::v4(), destination, "" );
DestinationEndpoint = *Resolver.resolve( query );
{
IcmpData icmp_data( "ping-message" );
- // Create an ICMP header for an echo request.
SequenceNumber++;
IcmpHeader::IcmpType type = IcmpHeader::EchoRequest;
uint8_t code = 0;
uint16_t checksum = calculator.compute( type, code, identifier, SequenceNumber );
IcmpHeader icmp_header( type, code, checksum, identifier, SequenceNumber );
- // Encode the ICMP header and data in an ICMP packet.
return IcmpPacket( icmp_header, icmp_data );
}