Library: Zeroconf
Package: ZeroCore
Header: Poco/Zeroconf/DNSServiceDiscovery.h
The singleton DNSServiceDiscovery acts as entry point for Zeroconf operations browse, resolve, and domain searching. The singleton is created and returned via the instance method. Note that your application must call its shutdown() method right before exiting!
Member Functions: addListener, browse, discoverDomainsForBrowsing, discoverDomainsForRegister, instance, remove, removeListener, resolve, shutdown
Destroys the DNSServiceDiscovery.
void addListener(
DiscoveryListener & listener
);
Convenience function which registers the listener at all service specific events. Note that you don't need to implement the DiscoveryListener interface If you have a class that offers some methods with the same signature you can register them manually at the individual events.
void addListener(
DomainListener & listener
);
Convenience function which registers the listener at all domain specific events. Note that you don't need to implement the DomainListener interface If you have a class that offers some methods with the same signature you can register them manually at the individual events.
DNSServiceRef browse(
const std::string & regType,
const std::string & domain
);
Browses for a service on all network interfaces restricted by regType and domain (domain can be empty). Results will be sent asnychronously via the EBrowseError, EServiceFound, EServiceRemoved events.
DNSServiceRef browse(
const std::string & regType,
const std::string & domain,
const Poco::Net::NetworkInterface & iface
);
Browses for a service on the defined network interface restricted by regType and domain (domain can be empty). Results will be sent asnychronously via the EBrowseError, EServiceFound, EServiceRemoved events.
DNSServiceRef discoverDomainsForBrowsing(
const Poco::Net::NetworkInterface & iface
);
Discovers domains for browse operations on the defined interface (use interface with index 0 to search on all interfaces) Results will be sent asnychronously via the EBrowseDomainFound, EBrowseDomainRemoved and EBrowseDomainError events.
DNSServiceRef discoverDomainsForBrowsing();
Discovers domains for browse operations on all network interfaces Results will be sent asnychronously via the EBrowseDomainFound, EBrowseDomainRemoved and EBrowseDomainError events.
DNSServiceRef discoverDomainsForRegister(
const Poco::Net::NetworkInterface & iface
);
Discovers domains for service registration on the defined interface (use interface with index 0 to search on all interfaces) Results will be sent asnychronously via the ERegisterDomainFound, ERegisterDomainRemoved and ERegisterDomainError events.
DNSServiceRef discoverDomainsForRegister();
Discovers domains for service registration on all network interfaces Results will be sent asnychronously via the ERegisterDomainFound, ERegisterDomainRemoved and ERegisterDomainError events.
static DNSServiceDiscovery & instance();
Returns the instance of the singleton.
void remove(
DNSServiceRef ref
);
Stops the activity assigned with the DNSServiceRef, invalidates the reference
void removeListener(
DiscoveryListener & listener
);
Convenience function which removes the listener from all events.
void removeListener(
DomainListener & listener
);
Convenience function which removes the listener from all events
DNSServiceRef resolve(
const ServiceInfo & info,
bool searchOnAllInterfaces
);
Resolves a ServiceInfo. Call browse to retrieve the ServiceInfo required as first parameter here. Results will be sent asnychronously via the EResolveError and EServiceResolved events.
void shutdown();
Stops all activity. Invalidates all DNSServiceRefs. THIS METHOD MUST BE INVOKED RIGHT BEFORE YOU EXIT YOUR APPLICATION!
Poco::BasicEvent < DomainError > EBrowseDomainError;
In case an error occurs while parsing for domains, this event signales the errorNumber
Poco::BasicEvent < std::pair < DomainInfo, bool > > EBrowseDomainFound;
1st param contains the detected domain, 2nd param tells if more events will follow immediately
Poco::BasicEvent < std::pair < DomainInfo, bool > > EBrowseDomainRemoved;
1st param contains the detected domain, 2nd param tells if more events will follow immediately
Poco::BasicEvent < ServiceError > EBrowseError;
An error happend while browsing
Poco::BasicEvent < DomainError > ERegisterDomainError;
In case an error occurs while parsing for domains, this event signales the errorNum
Poco::BasicEvent < std::pair < DomainInfo, bool > > ERegisterDomainFound;
1st param contains the detected domain, 2nd param tells if more events will follow immediately
Poco::BasicEvent < std::pair < DomainInfo, bool > > ERegisterDomainRemoved;
1st param contains the detected domain, 2nd param tells if more events will follow immediately
Poco::BasicEvent < ServiceError > EResolveError;
An error happend while trying to resolve a service
Poco::BasicEvent < std::pair < ServiceInfo, bool > > EServiceFound;
1st param contains serviceInfo, 2nd param tells if more events will follow immediately
Poco::BasicEvent < std::pair < ServiceInfo, bool > > EServiceRemoved;
1st param contains serviceInfo, 2nd param tells if more events will follow immediately
Poco::BasicEvent < std::pair < ResolvedServiceInfo, bool > > EServiceResolved;
1st param contains serviceInfo, 2nd param tells if more events will follow immediately