Fawkes API  Fawkes Development Version
fawkes::ServiceBrowseHandler Class Referenceabstract

Interface for class that process browse results. More...

#include <>>

Inheritance diagram for fawkes::ServiceBrowseHandler:

Public Member Functions

virtual ~ServiceBrowseHandler ()
 Virtual destructor. More...
 
virtual void all_for_now ()=0
 All results have been retrieved. More...
 
virtual void cache_exhausted ()=0
 Cache exhausted. More...
 
virtual void browse_failed (const char *name, const char *type, const char *domain)=0
 Failed to browse for a given service. More...
 
virtual void service_added (const char *name, const char *type, const char *domain, const char *host_name, const char *interface, const struct sockaddr *addr, const socklen_t addr_size, uint16_t port, std::list< std::string > &txt, int flags)=0
 A service has been announced on the network. More...
 
virtual void service_removed (const char *name, const char *type, const char *domain)=0
 A service has been removed from the network. More...
 

Detailed Description

Interface for class that process browse results.

Implement this class if you want to browse for services on the network. Then register your handler and it will be informed of services that join or leave the network. This is also required for an active search.

It is recommended that you read about mDNS, DNS-SD and Avahi.

Author
Tim Niemueller

Definition at line 46 of file browse_handler.h.

Constructor & Destructor Documentation

◆ ~ServiceBrowseHandler()

virtual fawkes::ServiceBrowseHandler::~ServiceBrowseHandler ( )
inlinevirtual

Virtual destructor.

Definition at line 50 of file browse_handler.h.

References all_for_now(), browse_failed(), cache_exhausted(), service_added(), and service_removed().

Member Function Documentation

◆ all_for_now()

virtual void fawkes::ServiceBrowseHandler::all_for_now ( )
pure virtual

All results have been retrieved.

If you read the DNS-SD specs you will see that there is no explicit "not existent" or "end of records" message - it cannot be. But after some time it is assumed that there are no more records. If that is the case this method is called.

Implemented in FireVisionNetworkTool, fawkes::ServiceModel, fawkes::AvahiDispatcher, BatteryMonitor, and WebviewServiceBrowseHandler.

Referenced by ~ServiceBrowseHandler().

◆ browse_failed()

virtual void fawkes::ServiceBrowseHandler::browse_failed ( const char *  name,
const char *  type,
const char *  domain 
)
pure virtual

Failed to browse for a given service.

Parameters
namename of the service
typetype of the service
domaindomain of the service

Implemented in FireVisionNetworkTool, fawkes::ServiceModel, fawkes::AvahiDispatcher, BatteryMonitor, and WebviewServiceBrowseHandler.

Referenced by ~ServiceBrowseHandler().

◆ cache_exhausted()

virtual void fawkes::ServiceBrowseHandler::cache_exhausted ( )
pure virtual

◆ service_added()

virtual void fawkes::ServiceBrowseHandler::service_added ( const char *  name,
const char *  type,
const char *  domain,
const char *  host_name,
const char *  interface,
const struct sockaddr *  addr,
const socklen_t  addr_size,
uint16_t  port,
std::list< std::string > &  txt,
int  flags 
)
pure virtual

A service has been announced on the network.

Parameters
namename of the service
typetype of the service
domaindomain of the service
host_namename of the host that provides the service
interfacename of network interface to reach service
addrpointer to sockaddr struct of appropriate type for address
addr_sizesize of addr struct
portport of the service
txtlist of txt records.
flagsextra flags, see Avahi documentation

Implemented in FireVisionNetworkTool, fawkes::ServiceModel, fawkes::AvahiDispatcher, BatteryMonitor, and WebviewServiceBrowseHandler.

Referenced by ~ServiceBrowseHandler().

◆ service_removed()

virtual void fawkes::ServiceBrowseHandler::service_removed ( const char *  name,
const char *  type,
const char *  domain 
)
pure virtual

A service has been removed from the network.

Parameters
namename of the service
typetype of the service
domaindomain of the service

Implemented in FireVisionNetworkTool, fawkes::ServiceModel, fawkes::AvahiDispatcher, BatteryMonitor, and WebviewServiceBrowseHandler.

Referenced by ~ServiceBrowseHandler().


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