esp8266ndn
NDN Arduino library for ESP8266 and more
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | List of all members
ndnph::PingClient Class Reference

Periodically transmit Interests to test reachability. More...

#include <ping-client.hpp>

Inherits ndnph::PacketHandler.

Classes

struct  Counters
 

Public Member Functions

 PingClient (Name prefix, Face &face, int interval=1000)
 Constructor. More...
 
Counters readCounters () const
 
- Public Member Functions inherited from ndnph::PacketHandler
 PacketHandler ()=default
 Construct without adding to Face. More...
 
 PacketHandler (Face &face, int8_t prio=0)
 Construct and add handler to Face. More...
 

Additional Inherited Members

- Public Types inherited from ndnph::PacketHandler
using PacketInfo = Face::PacketInfo
 
- Protected Member Functions inherited from ndnph::PacketHandler
virtual ~PacketHandler ()
 Remove handler from Face. More...
 
FacegetFace () const
 
const PacketInfogetCurrentPacketInfo () const
 Retrieve information about current processing packet. More...
 
template<typename Packet >
bool send (Region &region, const Packet &packet, PacketInfo pi={})
 Synchronously transmit a packet. More...
 
template<typename Packet , typename... PacketInfoModifier>
bool send (Region &region, const Packet &packet, const PacketInfoModifier &... pim)
 Synchronously transmit a packet. More...
 
template<typename Packet , typename... Arg, typename = typename std::enable_if< !std::is_base_of<Region, typename std::decay<Packet>::type>::value>::type>
bool send (const Packet &packet, Arg &&... arg)
 Synchronously transmit a packet. More...
 
template<typename... Arg>
bool reply (Arg &&... arg)
 Synchronously transmit a packet in reply to current processing packet. More...
 

Detailed Description

Periodically transmit Interests to test reachability.

This is a simple ping client implementation that can only keep one pending Interest. After sending a probe Interest, responses to previous Interests are no longer accepted. Therefore, interval must be greater than RTT, otherwise this client cannot receive any Data.

Constructor & Destructor Documentation

◆ PingClient()

ndnph::PingClient::PingClient ( Name  prefix,
Face face,
int  interval = 1000 
)
inlineexplicit

Constructor.

Parameters
prefixname prefix to request. It should have 'ping' suffix.
faceface for communication.
intervalInterest interval in milliseconds.

Member Function Documentation

◆ readCounters()

Counters ndnph::PingClient::readCounters ( ) const
inline

The documentation for this class was generated from the following file: