Re: Checks required for multiple asynchronous NSURLConnections?
Re: Checks required for multiple asynchronous NSURLConnections?
- Subject: Re: Checks required for multiple asynchronous NSURLConnections?
- From: Jean-Daniel Dupas <email@hidden>
- Date: Tue, 28 Jul 2009 09:25:29 +0200
Le 28 juil. 09 à 09:07, Debajit Adhikary a écrit :
I have multiple asynchronous HTTP requests being made at the same
time. All
these use the same NSURLConnection delegate functions. (The
receivedData
object is different for each connection though—this is done using a
dictionary with the key as the connection itself. In the delegate, I
parse
the receivedDate object, and do additional operations on those parsed
strings)
Everything seems to work fine for me so far, but I'm not sure if I
need to
do anything specific to ensure correct “multithreaded” behavior.
- Is it possible that more than two connections will use the
delegate at
the same time? (I would think so)
- If yes, how is it resolved? (Does Cocoa do this automatically?)
- Do I need to have additional checks in place to ensure that each
request is handled “correctly”?
Asynchronous does not mean multithreaded.
Now a simple exercice.
Open the NSURLConnection reference. search for thread.
First answer:
Note that these delegate methods will be called on the thread that
started the asynchronous load operation for the associated
NSURLConnection object.
_______________________________________________
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