48 std::string_view type,
65 std::unique_ptr<NetworkServiceDiscovery::Backend> backend,
66 std::string_view name,
67 std::string_view type,
72 struct WithBackendTag {};
74 std::unique_ptr<NetworkServiceDiscovery::Backend> backend,
75 std::string_view name,
76 std::string_view type,
80 NetworkServiceDiscovery nsd_;
81 bool published_ =
false;
108 std::unique_ptr<NetworkServiceDiscovery::Backend> backend,
109 std::string_view service_type,
113 struct WithBackendTag {};
115 std::unique_ptr<NetworkServiceDiscovery::Backend> backend,
116 std::string_view service_type,
119 void wire_callbacks(
Callback callback);
122 bool has_backend_ =
false;
mDNS-based network service discovery (Bonjour/DNS-SD).
Definition volume_detector.hpp:64
std::unordered_map< std::string, std::string > TxtRecords
TXT records carry arbitrary key=value metadata published with a service registration (RFC 6763 §6).
Definition volume_detector.hpp:72
static std::unique_ptr< ServiceBrowser > with_backend(std::unique_ptr< NetworkServiceDiscovery::Backend > backend, std::string_view service_type, Callback callback)
Construct a browser that uses a caller-supplied backend instead of the platform default.
ServiceBrowser(std::string_view service_type, Callback callback)
ServiceBrowser(const ServiceBrowser &)=delete
std::function< void(ServiceDiscoveryAction, const NetworkServiceDiscovery::Service &)> Callback
Definition service_discovery.hpp:92
NetworkServiceDiscovery & nsd() noexcept
Definition service_discovery.hpp:103
bool is_browsing() const noexcept
Definition service_discovery.hpp:101
ServiceBrowser & operator=(const ServiceBrowser &)=delete
ServicePublisher(const ServicePublisher &)=delete
static std::unique_ptr< ServicePublisher > with_backend(std::unique_ptr< NetworkServiceDiscovery::Backend > backend, std::string_view name, std::string_view type, uint16_t port, NetworkServiceDiscovery::TxtRecords txt_records={})
Construct a publisher that uses a caller-supplied backend instead of the platform default.
NetworkServiceDiscovery & nsd() noexcept
Access the underlying NSD object — for tests that want to install a fake backend instead of the platf...
Definition service_discovery.hpp:60
ServicePublisher(std::string_view name, std::string_view type, uint16_t port, NetworkServiceDiscovery::TxtRecords txt_records={})
ServicePublisher & operator=(const ServicePublisher &)=delete
bool is_published() const noexcept
Definition service_discovery.hpp:56
Definition child_process_manager.hpp:18
bool install_default_backend(NetworkServiceDiscovery &nsd)
Try to install the host platform's default mDNS backend on nsd.
ServiceDiscoveryAction
Action delivered to a ServiceBrowser callback.
Definition service_discovery.hpp:23
@ ServiceFound
Definition service_discovery.hpp:24
@ ServiceLost
Definition service_discovery.hpp:25
Definition volume_detector.hpp:74