• 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: [Bonjour] Any mechanism to deal with Aurevoir and re-bonjour?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bonjour] Any mechanism to deal with Aurevoir and re-bonjour?


  • Subject: Re: [Bonjour] Any mechanism to deal with Aurevoir and re-bonjour?
  • From: Michael Ledford <email@hidden>
  • Date: Thu, 21 Feb 2008 10:15:30 -0500


On Feb 21, 2008, at 5:24 AM, Stephane Sudre wrote:

That's a good question. I don't do anything to add the NSNetServiceBrowser to a run-loop. I assume from the documentation that it's automatically added to the current run-loop and that you can remove it or move it to another run-loop if needed.

I said this incase you were developing some type of command line tool. Those don't have run-loops and you have to install one your self.


The test I'm doing is the following one:

1. Search for _workstation._tcp.

2. Wait for the results

3. Connect to a remote Mac using ARD.

4. Change the IP of the Mac. (Quit ARD).

5. Wait for anything to happen in the sample code.

You might need to describe a bit more what you are trying to accomplish but let me outline what I believe is happening here. You need to think of bonjour as DNS records, since that's what it is. Multicast DNS. Most of the time the services will unregister themselves if they know they are changing state like a database server is shutdown. The mDNS would recognize that and send you a delegate method indicating that fact.


However, there are some situations that interfaces will go down and since the mDNS has cached the record it doesn't know anything has changed. It would be a horrible performance and resource drain if every time you did a search it actually went out to the network. If you try to resolve a service that is no longer available the mDNS will recognize that fact and then send you the delegate method netServiceBrowser:didRemoveService:moreComing:. Therefore it is best to wait as long as possible to resolve the service, be lazy. Don't resolve a service's address until the moment you need IP address if possible. Once connected to a service, most of the time, you should be able to tell if that service becomes unavailable. If it does you would then try to resolve that service again and if the IP address changed you would get it from the resolve, otherwise if it is not available you would get the netServiceBrowser:didRemoveService:moreComing: delegate method in addition to the failing of the resolve.

I am by no means a bonjour expert and this info comes from my limited knowledge about it. If anything seems wrong here I welcome someone to correct me.

I hope this helps!

Sincerely,
Michael

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


References: 
 >[Bonjour] Any mechanism to deal with Aurevoir and re-bonjour? (From: Stephane Sudre <email@hidden>)
 >Re: [Bonjour] Any mechanism to deal with Aurevoir and re-bonjour? (From: Michael Ledford <email@hidden>)
 >Re: [Bonjour] Any mechanism to deal with Aurevoir and re-bonjour? (From: Stephane Sudre <email@hidden>)

  • Prev by Date: Re: [Bonjour] Any mechanism to deal with Aurevoir and re-bonjour?
  • Next by Date: Re: [Bonjour] Any mechanism to deal with Aurevoir and re-bonjour?
  • Previous by thread: Re: [Bonjour] Any mechanism to deal with Aurevoir and re-bonjour?
  • Next by thread: Re: [Bonjour] Any mechanism to deal with Aurevoir and re-bonjour?
  • Index(es):
    • Date
    • Thread