3 ms·
Yes I just wish microsoft hadn't complicated it with LLMNR. All sorts of things use mDNS now (chromecast, spotify, printers, thermostats). And finally windows
by amaccuish 6y ago
Yes I just wish microsoft hadn't complicated it with LLMNR.
All sorts of things use mDNS now (chromecast, spotify, printers, thermostats). And finally windows will start to support mDNS so hopefully we can finally settle on one good autodiscovery protocol and get rid of the horror that is SSDP.
- giancarlostoro 6y agoI believe Microsoft finally added mdns to Windows 10, you might have to install it as a component yourself though. It's not yet available under Win32 though by the sound of it.
- ComputerGuru 6y agoHere’s some documentation: 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.... Lots of new core APIs added in Windows 10 aren’t available via Win32 even if they have nothing to do with packages, unfortunately. It’s extremely convoluted but you can use the Windows.Sdk, Contracts, or CsWinRT packages to interop with the WinRT APIs from a C++, C#, or now even rust application but depending on which APIs you consume you may need to use a Windows Application Project appx/msix wrapper to package your code and associate it with a package ID unlocking the APIs for use. (I have a hello world project demonstrating a WPF .NET Core project hosting a custom control consisting of a single text block that displays your current location via the Geolocator API and it requires four different individually user-created projects in the Visual Studio solution and a minimum half-a-dozen NuGet dependencies just to make it happen. It’s a terrible, terrible mess.)
- giancarlostoro 6y agoIt seems like they want to consolidate all those APIs with Project Reunion https://github.com/microsoft/ProjectReunion https://github.com/microsoft/ProjectReunion So I'm hoping this improved things in the future.
- ComputerGuru 6y agolol, I forgot to mention: this is with Project Reunion. WinUI 3, CsWinRt, etc.
- goont 6y agoThere 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 :)
- 6y ago