snapcast/server/publishZeroConf/publish_mdns.hpp
badaix b6a4ffa758 Server can run on a single thread
Number of threads can be configure in snapserver.conf:
[server]
threads = 1
2019-11-25 23:00:44 +01:00

44 lines
825 B
C++

#ifndef PUBLISH_MDNS_H
#define PUBLISH_MDNS_H
#include <boost/asio.hpp>
#include <string>
#include <vector>
struct mDNSService
{
mDNSService(const std::string& name, size_t port) : name_(name), port_(port)
{
}
std::string name_;
size_t port_;
};
class PublishmDNS
{
public:
PublishmDNS(const std::string& serviceName, boost::asio::io_context& ioc) : serviceName_(serviceName), ioc_(ioc)
{
}
virtual ~PublishmDNS() = default;
virtual void publish(const std::vector<mDNSService>& services) = 0;
protected:
std::string serviceName_;
boost::asio::io_context& ioc_;
};
#if defined(HAS_AVAHI)
#include "publish_avahi.hpp"
typedef PublishAvahi PublishZeroConf;
#elif defined(HAS_BONJOUR)
#include "publish_bonjour.hpp"
typedef PublishBonjour PublishZeroConf;
#endif
#endif