58 const String& serviceDescription,
68 const int broadcastPort;
130 std::vector<Service> services;
133 void handleAsyncUpdate()
override;
135 void handleMessage (
const Service&);
136 void removeTimedOutServices();
Has a callback method that is triggered asynchronously.
A wrapper for a datagram (UDP) socket.
Represents an IP address.
A relative measure of time.
static RelativeTime seconds(double seconds) noexcept
Creates a new RelativeTime object representing a number of seconds.
Holds an absolute date and time.
Used to build a tree of elements representing an XML document.
String instanceID
A UUID that identifies the particular instance of the Advertiser class.
Time lastSeen
The time of the last ping received from the advertiser.
int port
The port number of the advertiser.
String description
The service description as sent by the Advertiser.
IPAddress address
The IP address of the advertiser.
Contains classes that implement a simple protocol for broadcasting the availability and location of a...
Contains information about a service that has been found on the network.
An object which runs a thread to repeatedly broadcast the existence of a discoverable service.
Advertiser(const String &serviceTypeUID, const String &serviceDescription, int broadcastPort, int connectionPort, RelativeTime minTimeBetweenBroadcasts=RelativeTime::seconds(1.5))
Creates and starts an Advertiser thread, broadcasting with the given properties.
~Advertiser() override
Destructor.
Watches the network for broadcasts from Advertiser objects, and keeps a list of all the currently act...
AvailableServiceList(const String &serviceTypeUID, int broadcastPort)
Creates an AvailableServiceList that will bind to the given port number and watch the network for Adv...
std::function< void()> onChange
A lambda that can be set to receive a callback when the list changes.
~AvailableServiceList() override
Destructor.
std::vector< Service > getServices() const
Returns a list of the currently known services.