esp8266ndn
NDN Arduino library for ESP8266 and more
|
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. | |
Counters | readCounters () const |
![]() | |
PacketHandler ()=default | |
Construct without adding to Face. | |
PacketHandler (Face &face, int8_t prio=0) | |
Construct and add handler to Face. | |
Private Member Functions | |
void | loop () final |
Override to be invoked periodically. | |
bool | processData (Data data) final |
Override to receive Data packets. | |
Additional Inherited Members | |
![]() | |
using | PacketInfo = Face::PacketInfo |
![]() | |
virtual | ~PacketHandler () |
Remove handler from Face. | |
Face * | getFace () const |
const PacketInfo * | getCurrentPacketInfo () const |
Retrieve information about current processing packet. | |
template<typename Packet > | |
bool | send (Region ®ion, const Packet &packet, PacketInfo pi={}) |
Synchronously transmit a packet. | |
template<typename Packet , typename... PacketInfoModifier> | |
bool | send (Region ®ion, const Packet &packet, const PacketInfoModifier &... pim) |
Synchronously transmit a packet. | |
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. | |
template<typename... Arg> | |
bool | reply (Arg &&... arg) |
Synchronously transmit a packet in reply to current processing packet. | |
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.
prefix | name prefix to request. It should have 'ping' suffix. |
face | face for communication. |
interval | Interest interval in milliseconds. |
|
inlinefinalprivatevirtual |
Override to be invoked periodically.
Reimplemented from ndnph::PacketHandler.
|
inlinefinalprivatevirtual |
Override to receive Data packets.
true | packet has been accepted by this handler. |
false | packet is not accepted, and should go to the next handler. |
Reimplemented from ndnph::PacketHandler.
|
inline |