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: Duration of functions



Terry,

Which functions can be expected to complete right away, and which may take a
long time. And, how long is a "long time"?

This isn't a simple answer.


How long could a resolve take?

If the service exists on the network, your resolve callback should be called within 10 milliseconds, however, when on 802.11 AirPort, sometimes multicast packets get lost so this could take seconds depending on network conditions.



How long could a browse for services take (for services that are register at
the start of the browse)

It depends on how many services exist on the network and it depends on network conditions. It could take 1, 3, 5, 10 seconds to find every service.



How long could a register take?

Register's should complete within 1 second, but if a name collision occurs it could take longer.



How long could it take to notice a collision?

It depends on how many collisions occur. Name collisions can occur at any time while running your application, so even if the name is registered successfully at first, it's still possible that 30 minutes later, somebody could connect a new hub with a service name that conflicts with you, and you'll need to handle that situation.



They can all be done asynchronously, so I would guess that means they could
all take a "long time". But, are there limits or timeouts where I could
assume these functions would never take more than X seconds?

It might help to implement timers for things like a resolve because you normally don't want to leave a resolve running for very long. If the user double-clicks on a service name in a browser list, at that point you should try to resolve the service, and the recommendation is to bring up a dialog that says "Connecting..." and while the dialog is up, keep the resolve running but allow the user to cancel the resolve if they get impatient. Starting in Panther, the act of canceling the resolve will remove the service from your browse list and the service will also disappear from everyone else's browse list on the network.


Browsing should be left running for as long as the user is looking at the list of services, since services can come and go at any time. When the user is done looking at the list, you should cancel the browse.

Some applications like iTunes and iChat always have the browse list open, so those applications keep the browse operation running for the entire life of the application.

-Marc
_______________________________________________
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: 
 >Duration of functions (From: Terry <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.