Re: Checks required for multiple asynchronous NSURLConnections?
Re: Checks required for multiple asynchronous NSURLConnections?
- Subject: Re: Checks required for multiple asynchronous NSURLConnections?
- From: Kyle Sluder <email@hidden>
- Date: Tue, 28 Jul 2009 00:32:08 -0700
On Jul 28, 2009, at 12:07 AM, Debajit Adhikary <email@hidden>
wrote:
- Is it possible that more than two connections will use the
delegate at
the same time? (I would think so)
Asynchronous does not always mean your callbacks are invoked on
another thread -- or that threads are even involved at all. The system
can synchronously dispatch the HTTP connection, ad itself as an input
source to the current runloop, and return to your code, firing at the
appropriate time.
Since the documentation states that callbacks are called on the same
thread as the asynchronous call is made, two can't execute at once (as
long as all your connections are made on the same thread).
- If yes, how is it resolved? (Does Cocoa do this automatically?)
Re-read the run loops documentation and then the NSURLConnection
documentation again.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden