OpenCPN Partial API docs
|
Singleton cache for hosts looked up using mdns. More...
#include <mdns_cache.h>
Classes | |
struct | Entry |
Public Member Functions | |
MdnsCache & | operator= (MdnsCache &)=delete |
MdnsCache (const MdnsCache &)=delete | |
void | Validate () |
Check that all entries are accessible, remove stale ones. | |
bool | Add (const Entry &entry) |
Add new entry to the cache. More... | |
bool | Add (const std::string &service, const std::string &host, const std::string &_ip, const std::string &_port) |
Add new entry to the cache. More... | |
bool | Add (const std::string &_ip, const std::string &_port) |
Add a manual entry where only IP and port is known. More... | |
const std::vector< Entry > & | GetCache () const |
Return read-only cached entries reference. | |
Static Public Member Functions | |
static MdnsCache & | GetInstance () |
Singleton cache for hosts looked up using mdns.
A critical region accessed both by timer routines and the main thread.
Entries are added by the various Add() signatures. The Validate() method removes all entries where to host does not respond to a http request on on port 8443.
Definition at line 37 of file mdns_cache.h.
bool MdnsCache::Add | ( | const Entry & | entry | ) |
Add new entry to the cache.
Definition at line 51 of file mdns_cache.cpp.
bool MdnsCache::Add | ( | const std::string & | _ip, |
const std::string & | _port | ||
) |
Add a manual entry where only IP and port is known.
Definition at line 67 of file mdns_cache.cpp.
bool MdnsCache::Add | ( | const std::string & | service, |
const std::string & | host, | ||
const std::string & | _ip, | ||
const std::string & | _port | ||
) |
Add new entry to the cache.
Definition at line 62 of file mdns_cache.cpp.