Bonsoir
Bonsoir copied to clipboard
Windows support
Is your feature request related to a problem? Please describe. No.
Describe the solution you'd like Be able to use this package in my flutter desktop windows app
Describe alternatives you've considered ... Additional context I'll be very grateful if you add windows support for this package.
Thanks!!!
Yeah! That would be cool to use that package on desktop.
I agree, but I think I will need some help for this one π
win32
https://docs.microsoft.com/en-us/windows/win32/api/windns/nf-windns-dnsservicebrowse https://docs.microsoft.com/en-us/windows/win32/api/windns/nf-windns-dnsserviceregister
uwp
https://docs.microsoft.com/en-us/uwp/api/windows.networking.servicediscovery.dnssd
FYI, Here are documents of Windows API.
This would be nice. In the interim, I've forked and patched version of the Flutter standard mdns library that is usable on Windows desktop:
https://github.com/0xnf/flutter_multicast_dns
I run bonsoir for mobile, and the multicast_dns for Mac and Windows desktops. It's working fine for now, but I'd course like to unify to one well-maintained library in the future.
I agree, but I think I will need some help for this one π
Is there any plan to support windows? π
@zzdota
Is there any plan to support windows? π
Not from my side, but you're free to do work on it π
Hi.
I am the author of a Linux platform interface and I was wondering if you guys were interested in Windows support, and if so: which ones would they be.
- Windows support by linking directly to the dns_sd.h library (requires having at least Bonjour Print Services installed on client's computers, but works on older versions of Windows).
- Windows 10 support by wrapping mDNS APIs in windows platform directly. (only windows 10 support, no external requirements needed)
- Best effort support by beating multicast_dns into an embedded multicast dns responder/resolver (works on any dart version, but it might conflict with an existing mDNSResponder)
Right now, as an experiment, I've wrapped dns_sd.h into an async wrapper for Dart and it would be not hard to add flutter support now that the package is federated.
I think it would be best to go with option 2, considering that Windows 10 and 11 currently hold a combined ~85% market share, and while flutter technically still supports 7 and 8, they are already considered EOL by Microsoft and many software vendors are increasingly cutting support for <10.
Plus, having no external requirements is a big plus from an UX standpoint (assuming you are developing an application intended for distribution)
Just a quick notice:
I needed basic windows support for my application and implemented option 1(using dns_sd.h
) myself a few days ago. As @TheBITLINK says, option 2 would be the better option but I did not get it to work straight away so I fell back to dns_sd.h
.
As of now my implementation is a proof of concept with some known bugs, you can check it out here.
I'll follow your PR @Bennik2000 π
@Bennik2000 : I tried the current state of your implementation in a project of mine - works very nicely, but has one bug:
Bonjour SDK requires/provides ports as uint16_t, but with the bytes swapped. Otherwise the results come out wrong: I scanned for a service on port 3000 (0x0BB8) and got 47115 (0xB80B) as a result - can't connect to the service on that port...
You'll need to swap the bytes of the port in bonsoir_discovery.cpp --> DNSServiceResolveCallback (swap the bytes of the port parameter before you store it in service.port), also in bonsoir_broadcast.cpp --> startBroadcast (swap bytes of service.port before you use it as parameter of DNSServiceRegister() )
Guess you'll want to fix that in your pull request...
Don't want to mess up your repository (not sure what happens if I create a PR on your PR???), so better if you fix that directly in your PR than me getting in the way - OK?
another interesting π€―experience: using the Bonjour SDK will not work with newer versions of the Bonjour service. I had Bonjour 3.1.0.1 installed on one of my PCs - running my Flutter app on that one kept crashing my app during Bonjour discovery. Uninstalling 3.1.0.1 and installing 3.0.0.1 (came with the SDK) made everything nice and good again. Looks like there are some breaking changes in newer versions of Bonjour vs. the SDK.
I'm not enough of an expert to get deeper into this - for the moment, I've got things limping along, but maybe the better path would actually be to use native windows functions (option 2)...