#pragma once #include #include #include namespace sc { struct DiscoveredPeer { std::string service_name; std::string host; uint16_t signaling_port = 0; }; class DiscoveryService { public: using PeerCallback = std::function; virtual ~DiscoveryService () = default; // Announce this peer on the LAN. virtual bool announce ( const std::string &service_name, uint16_t signaling_port ) = 0; // Browse for peers; callback is invoked for each newly found service. virtual bool browse ( PeerCallback on_peer ) = 0; virtual void stop () = 0; }; class DiscoveryFactory { public: static std::unique_ptr create_avahi (); }; } // namespace sc