stbuehler/rust-async-dnssd

Use native Windows 10 DNS-SD API?

Closed this issue · 2 comments

Title, would be useful to be able to use the native Windows 10 DNS-SD API (which is in dnsapi.dll) - which would remove the Bonjour dependency, and allow ARM64 windows compilation.

https://docs.microsoft.com/en-us/windows/win32/api/windns/nf-windns-dnsservicebrowse

This is not the API https://developer.apple.com/documentation/dnssd provides (not even close), so no.

You'll have to wrap the windows API yourself (or find someone else to do it); you could then build a "high-level" crate that chooses from whatever backend implementation you want to support.

The windows API is callback based (probably running in a background thread, which will also run the callbacks - i.e. you'll need thread-safe handling); it should be doable to integrate it into rust async using channels from futures (I think you'll need unbounded ones, because the callbacks can't handle backpressure / "async send").

I created a very small crate that uses the Windows UWP API for DNS-SD. I have not the slightest idea what I did there, but at least it works. Maybe you're interested, @aspenluxxxy.