Great to hear you've thought about it, it makes very good sense to keep this implementation at the Juce library level, given that it will then allow seamless network interoperability across Win/OSX/iOS.
Just bumping this thread, has there been any more consideration to adding Bonjour into JUCE? Would be a greatly appreciated feature, and open up a lot of options for clean clean user experience when connecting devices.
I have used it on OSX and Linux using the Apple provided API. I built mDNSResponder for Linux to use it and it seems to work pretty well. It might be better to have a consistent experience on top of mDNSResponder/Avahi/Windows whatever though.
After more searching on the forum (which I should’ve done in the first place before resurrecting this thread), I see that the JUCE team likely does not plan to implement a wrapper for Bonjour/Zeroconf network discovery, leaving this to the more heavyweight existing libraries.
If anybody is looking for a solution, JUCE has a basic NetworkServiceDiscovery implementation, but, as it has been pointed out, this is not intended to be the most robust implementation.
I’m the one implementing the Servus wrapper.
I have been updating it recently because most implementation (including Anthony’s one) seem to not include the IP lookup after hostname resolving.
That means that you end up with a hostname and port but no IP, which is kind of the one thing people are looking for…
I have modified Servus on windows to include this feature, and as I modified the Bonjour calls, I guess OSX should work as well if you recompile.
You can see the modified repo here : https://github.com/benkuper/Servus
@TimArt thanks for linking to my github repo and post. To be honest I haven’t been giving it the attention it deserves due to work commitments. However if anyone wants to use it and needs help with it please do reach out to me on here. I may use it in commercial applications in the future, if I do it will force me to give it the TLC it requires.
@benkuper@anthony-nicholls Thank you both for your replies and updates on the status of your different zeroconf wrappers! I am excited to look into these and see what I can get working for my project.
@benkuper When you mention the problem that some implementations:
I am slightly confused about this as I thought this was one of the main purposes of a zeroconf implementation. I assume this IP lookup code already exists in the implementations of zeroconf (Bonjour, Avahi, etc.), and it’s just a matter of calling this from the wrapper implementation as you did in your modified version of Servus?
Also, @benkuper I enjoyed checking out some of your work displayed on your website, and it’s some amazing stuff! I am really interested in this interactivity stuff with music and lighting and am currently working on an bodymovement-to-OSC kind of app myself. Your Chataigne seems like an amazing tool!