3 ms·
There is an API exposed in Windns.h but it doesn't work very well. It's awkward to use and doesn't pick up on services being added and removed. See `DnsService*
by goont 6y ago
There is an API exposed in Windns.h but it doesn't work very well. It's awkward to use and doesn't pick up on services being added and removed. See `DnsService*`, etc in https://docs.microsoft.com/en-us/windows/win32/api/windns/ https://docs.microsoft.com/en-us/windows/win32/api/windns/.
- Fredej 6y agoI believe that's deprecated. The right thing to do - though very well hidden - is to use device enumeration: https://docs.microsoft.com/en-us/windows/uwp/devices-sensors/enumerate-devices-over-a-network https://docs.microsoft.com/en-us/windows/uwp/devices-sensors... This uses mDNS under the hood and works pretty well now. The basics is that you create a device watcher and set it up to look for devices of a specific kind. In this case, you're looking for network-based devices with a specific service type. It's however somewhat of a pain to get running as there's a lot of details you need to know / figure out before you can get running.
- goont 6y agoHave you shipped anything using that API? I'm just a bit weary of wasting time on another half-baked solution. And are you sure the Windns.h API is deprecated? I could have sworn it only showed up last year.
- Fredej 6y agoI'm in the process of doing so. We had some issues with it initially but it seemed that it got better since a couple of updates ago. I vastly prefer it to having to ship mdnsresponder alongside my application though. I'm basing my "deprecated" comment on this: https://docs.microsoft.com/en-us/uwp/api/Windows.Networking.ServiceDiscovery.Dnssd?redirectedfrom=MSDN&view=winrt-19041 https://docs.microsoft.com/en-us/uwp/api/Windows.Networking.... However that looks to be different from the windns.h stuff. To be honest, I wasn't aware of windns.h and just assumed it was the above link you were talking about. It's probably worth taking a look at :)
- goont 6y ago> I vastly prefer it to having to ship mdnsresponder alongside my application though. That's what I'm seeking to avoid too. I'll have to take a closer look at the device enumeration API next time I circle around to the Windows port. Thanks for sharing your experience with it.