I'm working on an app that uses zeroconf to discover a monome connected to my computer. I have it working... but my code is really ugly :( Basically, I wrote it in C to allow for it to work crossplatform (hopefully) and it uses static functions. I want to write the service name, port, and address to a value tree, but I can't access the local member variables in a static function, and making the ValueTree static doesn't allow me to initialize it.
What I ended up doing was making a data model that was a global singleton... but that seems real ugly, and makes it difficult to reuse the zerconf classes in new apps.
The zerconf code more or less looks like this, but inside a JUCE thread:
Resolving a service
Browsing for service
...and if anyone is interested, here is a good chapter from O-Rielly on implementing zeroconf. http://oreilly.com/catalog/bonjour/chapter/ch07.pdf
any ideas, or thoughts on good ways to hook this into a main component would be greatly appreciated.