• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSNetServiceBrowser / NSNetService Hostname Lookup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSNetServiceBrowser / NSNetService Hostname Lookup


  • Subject: Re: NSNetServiceBrowser / NSNetService Hostname Lookup
  • From: Nicko van Someren <email@hidden>
  • Date: Fri, 22 Apr 2005 17:57:41 +0100

On 22 Apr 2005, at 17:44, Marc Krochmal wrote:

On Apr 21, 2005, at 8:01 PM, Adam wrote:

I read about NSNetServiceBrowser and I wrote a small app that could detect the rendezvous / bonjour iTunes sharing service on the network using NSNetServiceBrowser and NSNetService with a service type of _daap._tcp.

NSNetService returns a struct sockaddr that has the IP address and the port of the machine broadcasting the service. However, I would also like to get the hostname / Computer Name of the machine broadcasting this service. How could I obtain this info?

There's no easy way to retrieve the Computer Name of the service, but starting in Tiger, you'll be able to get the hostname after resolving the service by using the new NSNetService "hostName" method. If you need to get the hostname in Panther, then you'll need to use DNSServiceResolve() located in /usr/include/dns_sd.h.

Since an Apple employee has set the precedent, does this mean we are now allowed to discuss the API extensions to 10.4? It's surely in Apple's interest for as many of us as possible to be able to support Tiger sooner rather than later.


	Nicko

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSNetServiceBrowser / NSNetService Hostname Lookup
      • From: Marc Krochmal <email@hidden>
References: 
 >NSNetServiceBrowser / NSNetService Hostname Lookup (From: Adam <email@hidden>)
 >Re: NSNetServiceBrowser / NSNetService Hostname Lookup (From: Marc Krochmal <email@hidden>)

  • Prev by Date: Re: NSNetServiceBrowser / NSNetService Hostname Lookup
  • Next by Date: Re: NSNetServiceBrowser / NSNetService Hostname Lookup
  • Previous by thread: Re: NSNetServiceBrowser / NSNetService Hostname Lookup
  • Next by thread: Re: NSNetServiceBrowser / NSNetService Hostname Lookup
  • Index(es):
    • Date
    • Thread