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