Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about retrieving port numbers



Eric,

Thanks for your thoughts. I hadn't thought to use the DNSServiceDiscovery APIs because I thought they were for the Mac-Only.

I've changed my Posix stuff into DNSServiceDiscovery APIs and it works but it won't compile on BSD because it looks for the header "stdint.h". I looked and this seems to be a Mac OS X-only header.

So my question is, if there an API for rendezvous that will work on the following platforms with minimal #ifdefs for platform?

- Windows
- Mac OS X
- FreeBSD

If so, which header should I use and what directory is it in?

_ michael

On Jul 16, 2004, at 5:58 PM, Eric Wing wrote:

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
_______________________________________________
rendezvous mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/rendezvous
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: Question about retrieving port numbers (From: Eric Wing <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.