I'm not sure exactly what your goals are, but can you
use the DNSServiceDiscovery APIs which are the socket
based APIs for Rendezvous (which correspond to
CFNetServices for Carbon and NSNetService for Cocoa)?
My impression was that the code in
mDNSResponder/mDNSPosix was for implementing the
mDNSResponder daemon and library for a new Posix
platform. Once you build the two and install them, use
can use the DNSServiceDiscovery APIs (installed to
/usr/include/dns_sd.h) to register, browser, and
resolve services. mDNSResponder/Clients has an dns-sd
example that uses that API. And Apple has
documentation on DNSServiceDiscovery.
But maybe you are implementing Rendezvous for a new
platform in which case you can probably ignore
everything I just said.
But to your original problem, yes, once you browse,
you still need to Resolve a service to retrieve a port
number. DNSServiceResolveReply() in the aforementioed
API will provide you the port name and some service
names. You may be able to do a gethostbyname() on
hosttarget, but I discovered that you need libnss_mdns
to handle the .local. suffix, and it hasn't yet been
ported to FreeBSD and Solaris. To get around this,
I've been told to use DNSServiceQueryRecord() to
directly query for the ip address, but I'm currently
having problems with it and seeking help in another
thread :)
Anyway, if any of this stuff sounds useful, you might
check out my other threads from the past few days in
the mailing list archive.
-Eric
--- email@hidden wrote:
Hello all,
I found and read the docs and some earlier archives
on this list and I
think I've only done half of the work. I've browsed
for services and have
the names of them, but the next step is to take
those names and translate
them into actual services using
mDNS_StartResolveService().
Someone earlier had a similar question...
http://lists.apple.com/archives/rendezvous/2003/Feb/19/
obtaininganipaddrfromana.001.txt
Believe me, I'd love to do a cocoa only
implementation, but for things to
fly here, I have to show them cross platform.
Thanks for everyone's input.
_ michael