AlteriomPainlessMesh v2.1.1
Easy ESP32/ESP8266 mesh networking with Alteriom IoT extensions
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
painlessmesh::gateway::NegativeDnsCache Class Reference

A few hosts that recently failed to resolve, and when. More...

#include <gateway.hpp>

Public Types

enum  : size_t { SLOTS = 4 }
 

Public Member Functions

void remember (const TSTRING &host, uint32_t nowMs, uint32_t ttlMs=GATEWAY_DNS_NEGATIVE_TTL_MS)
 
bool isFailing (const TSTRING &host, uint32_t nowMs, uint32_t *ageMs=nullptr)
 
void forget (const TSTRING &host)
 
size_t size () const
 

Detailed Description

A few hosts that recently failed to resolve, and when.

Small and fixed: a gateway talks to a handful of destinations. A host is remembered with a TTL; while it is within it, isFailing() says so and the caller answers the request without a lookup.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : size_t
Enumerator
SLOTS 

Member Function Documentation

◆ forget()

void painlessmesh::gateway::NegativeDnsCache::forget ( const TSTRING &  host)
inline

◆ isFailing()

bool painlessmesh::gateway::NegativeDnsCache::isFailing ( const TSTRING &  host,
uint32_t  nowMs,
uint32_t *  ageMs = nullptr 
)
inline

Is host inside its negative TTL? ageMs receives how long ago it failed.

◆ remember()

void painlessmesh::gateway::NegativeDnsCache::remember ( const TSTRING &  host,
uint32_t  nowMs,
uint32_t  ttlMs = GATEWAY_DNS_NEGATIVE_TTL_MS 
)
inline

◆ size()

size_t painlessmesh::gateway::NegativeDnsCache::size ( ) const
inline

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