Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
MDNS Class Reference

MDNS abstraction object. More...

#include <MDNS.hxx>

Public Member Functions

void unpublish (const char *name, const char *service)
 Constructor.
 
void commit ()
 Commit the mDNS publisher.
 

Static Public Member Functions

static int lookup (const char *service, struct addrinfo *hints, struct addrinfo **addr)
 Lookup an mDNS name.
 
static void scan (const char *service)
 Start continuous scan for mDNS service name.
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (MDNS)
 

Detailed Description

MDNS abstraction object.

Definition at line 62 of file MDNS.hxx.

Member Function Documentation

◆ commit()

void MDNS::commit ( )
inline

Commit the mDNS publisher.

Definition at line 117 of file MDNS.hxx.

◆ lookup()

int MDNS::lookup ( const char *  service,
struct addrinfo hints,
struct addrinfo **  addr 
)
static

Lookup an mDNS name.

Parameters
serviceservicename to lookup
hintshints about limiting the types of services that will respond
addrinfostructure containing one or more service addressess that match the enquery, else nullptr if no matching service found
Returns
0 upon success, or appropriate EAI_* error on failure, use freeaddrinfo() to free up memory allocated to the non nullptr *addr returned

Definition at line 149 of file MDNS.cxx.

◆ scan()

void MDNS::scan ( const char *  service)
static

Start continuous scan for mDNS service name.

Parameters
serviceservicename to scan

Definition at line 243 of file MDNS.cxx.

◆ unpublish()

void MDNS::unpublish ( const char *  name,
const char *  service 
)

Constructor.

Unpublish an mDNS name.

Parameters
namelocal "username" or "nodename" of the service
serviceservice name, example: "_openlcb._tcp"

Definition at line 137 of file MDNS.cxx.


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