A simple mDNS responder written in Qt
qMDNS is a library that allows your Qt applications to interact with a mDNS network group without the need of installing Bonjour or Avahi. qMDNS works on every operating system that supports the Qt networking module.
qMDNS is a singleton class, you can call it anywhere from your application using:
#include <qMDNS.h>
Chat::Chat() {
connect (qMDNS::getInstance(), &qMDNS::hostFound,
this, &Chat::onHostFound);
findBob();
}
void Chat::findBob() {
qMDNS::getInstance()->lookup ("bob-computer.local");
}
void Chat::onHostFound (const QHostInfo& info) {
qDebug() << "Bob is at" << info.addresses().first();
}
This project is released under the MIT license.