Poco::Zeroconf

class DiscoveryListener

Library: Zeroconf
Package: ZeroCore
Header: Poco/Zeroconf/DiscoveryListener.h

Description

A DiscoveryListener handles DNSServiceDiscovery events for browse/resolve commands

Member Summary

Member Functions: disable, enable, onBrowseError, onNewService, onResolveError, onServiceRemoved, onServiceResolved

Constructors

DiscoveryListener

DiscoveryListener();

Creates the DiscoveryListener.

Destructor

~DiscoveryListener virtual

virtual ~DiscoveryListener();

Destroys the DiscoveryListener.

Member Functions

disable

void disable();

Disables event receiving. You must call this method, before your object is destroyed.

enable

void enable();

Enables event receiving. Call this method in the code of your subclass.

onBrowseError virtual

virtual void onBrowseError(
    const void * pSender,
    ServiceError & err
) = 0;

Called whenever an error occurred.

onNewService virtual

virtual void onNewService(
    const void * pSender,
    std::pair < ServiceInfo,
    bool > & aService
) = 0;

Called whenever a new service is discovered. ServiceInfo contains the service description, while the boolean value simply tells if more events will follow (can be used as hint for GUI applications to minimize redraws). Note that you will receive for each interface on which the service was discovered a notify.

onResolveError virtual

virtual void onResolveError(
    const void * pSender,
    ServiceError & err
) = 0;

Called whenever an error occurred.

onServiceRemoved virtual

virtual void onServiceRemoved(
    const void * pSender,
    std::pair < ServiceInfo,
    bool > & aService
) = 0;

A previously found service was removed. Called for each interface on which the service was removed.

onServiceResolved virtual

virtual void onServiceResolved(
    const void * pSender,
    std::pair < ResolvedServiceInfo,
    bool > & aService
) = 0;

Called whenever a new service is resolved. ResolvedServiceInfo contains an extended service description, while the boolean value simply tells if more events will follow (can be used as hint for GUI applications to minimize redraws). Note that you will receive for each interface on which the service was discovered a notify.