> On Sep 23, 2016, at 1:44 PM, James Crate <[email protected]> wrote:
> 
> Does anyone know if there is a Bonjour service discovery plugin available? I 
> thought I had seen something like that once upon a time but now I can’t find 
> anything.

I figured I might as well update the list on how I eventually got this stuff 
working. The setup is that I had a 4D runtime merged app that needed to 
discover another machine on the local network with Bonjour and then interact 
with the webserver on that machine using http digest authentication. My 
previous solution was a custom UDP listener on the webserver machine with a bit 
of UDP broadcast code in 4D to find that machine. With the upgrade to V15/macOS 
10.11, 4D could no longer reliably find the other machine. Accessing the server 
using 4D IC also became unreliable with V15/macOS 10.11.

After trying a couple different options to work with Bonjour service discovery, 
it turned out to be trivial to write a command line tool (Xcode, Objective-C 
using NSNetServiceBrowser) for Bonjour discovery that could be easily bundled 
with the the merged app and run via LEP. So, service discovery part solved! It 
was so easy I’m embarrassed I didn’t think of that years ago instead of 
building the custom UDP broadcast/response protocol.

4D’s HTTP Get command didn’t work with digest authentication due to a bug in 
the implementation. So, I changed my old http client code which did proper 
digest authentication to use HTTP Get instead of 4DIC (using HTTP Get without 
authentication and building the headers myself). However, the built-in HTTP Get 
turned out to be somewhat unreliable at resolving the machine name returned by 
the service discovery tool (~ 10% failure rate, IIRC). The curl tool, however, 
worked every time and also handled digest authentication properly as well. 

Jim Crate

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to