2013-01-16 14:56:31 +01:00
|
|
|
#ifndef ZEROCONF_H
|
|
|
|
#define ZEROCONF_H
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
class Zeroconf {
|
|
|
|
public:
|
|
|
|
virtual ~Zeroconf();
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
void Publish(const QString& domain, const QString& type, const QString& name,
|
|
|
|
quint16 port);
|
2013-01-16 14:56:31 +01:00
|
|
|
|
|
|
|
static Zeroconf* GetZeroconf();
|
|
|
|
|
2013-02-22 14:39:29 +01:00
|
|
|
// Truncate a QString to 63 bytes of UTF-8.
|
|
|
|
static QByteArray TruncateName(const QString& name);
|
|
|
|
|
2013-02-22 15:29:00 +01:00
|
|
|
protected:
|
2014-02-07 16:34:20 +01:00
|
|
|
virtual void PublishInternal(const QString& domain, const QString& type,
|
|
|
|
const QByteArray& name, quint16 port) = 0;
|
2013-02-22 15:29:00 +01:00
|
|
|
|
2013-01-16 14:56:31 +01:00
|
|
|
private:
|
|
|
|
static Zeroconf* sInstance;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ZEROCONF_H
|