mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
zeroconf updates (#421)
* zeroconf: add ip make names more uniq * tune dns name for webconfig
This commit is contained in:
@@ -368,35 +368,27 @@ void HyperionDaemon::startNetworkServices()
|
||||
|
||||
// zeroconf description - $leddevicename@$hostname
|
||||
const QJsonObject & generalConfig = _qconfig["general"].toObject();
|
||||
const std::string mDNSDescr = ( generalConfig["name"].toString("").toStdString()
|
||||
+ "@" +
|
||||
QHostInfo::localHostName().toStdString()
|
||||
);
|
||||
const QString mDNSDescr = generalConfig["name"].toString("") + "@" + QHostInfo::localHostName();
|
||||
|
||||
// zeroconf udp listener
|
||||
if (_udpListener != nullptr) {
|
||||
if (_udpListener != nullptr)
|
||||
{
|
||||
BonjourServiceRegister *bonjourRegister_udp = new BonjourServiceRegister();
|
||||
bonjourRegister_udp->registerService(
|
||||
BonjourRecord(mDNSDescr.c_str(), "_hyperiond-udp._udp", QString()),
|
||||
_udpListener->getPort()
|
||||
);
|
||||
BonjourRecord(mDNSDescr + ":" + QString::number(_udpListener->getPort()), "_hyperiond-udp._udp", QString()), _udpListener->getPort() );
|
||||
Debug(_log, "UDP LIstener mDNS responder started");
|
||||
}
|
||||
|
||||
// zeroconf json
|
||||
BonjourServiceRegister *bonjourRegister_json = new BonjourServiceRegister();
|
||||
bonjourRegister_json->registerService(
|
||||
BonjourRecord(mDNSDescr.c_str(), "_hyperiond-json._tcp", QString()),
|
||||
_jsonServer->getPort()
|
||||
);
|
||||
bonjourRegister_json->registerService(
|
||||
BonjourRecord(mDNSDescr + ":" + QString::number(_jsonServer->getPort()), "_hyperiond-json._tcp", QString()), _jsonServer->getPort());
|
||||
Debug(_log, "Json mDNS responder started");
|
||||
|
||||
// zeroconf proto
|
||||
BonjourServiceRegister *bonjourRegister_proto = new BonjourServiceRegister();
|
||||
bonjourRegister_proto->registerService(
|
||||
BonjourRecord(mDNSDescr.c_str(), "_hyperiond-proto._tcp", QString()),
|
||||
_protoServer->getPort()
|
||||
);
|
||||
BonjourRecord(mDNSDescr + ":" + QString::number(_jsonServer->getPort()), "_hyperiond-proto._tcp", QString()), _protoServer->getPort());
|
||||
Debug(_log, "Proto mDNS responder started");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user