mDNS queryService for self reports nothing?
Posted: Mon Oct 22, 2018 5:25 pm
I have the following code which I -expected- would return my own service that I just successfully added. A delay doesn't help!
Does anyone know why this wouldn't work (ie: queryService returns 0)? And in any event, all I'm looking for is my own hostname that I can see publicly in a Bonjour browser, like LEDWifi-2 or LEDWifi-3, depending on what order they boot up in!
Code: Select all
if (g_mDNS.begin("LEDWifi"))
{
Serial.println("mDNS registered");
g_mDNS.addService("nightdriver", "tcp", 81);
}
else
Serial.println("ERROR: mDNS failed to register");
if (0 == g_mDNS.queryService("nightdriver", "tcp"))
Serial.println("WARNING: Did not find _nightdriver._tcp service");