Re: NSURLConnection not reentrant?
Re: NSURLConnection not reentrant?
- Subject: Re: NSURLConnection not reentrant?
- From: Ed Voas <email@hidden>
- Date: Mon, 21 Nov 2005 16:22:40 -0800
Jerry Krinock wrote:
on 05/11/21 11:15, Ed Voas at email@hidden wrote:
I can't see anything in the docs about this, but we have a situation
where in the connectionDidFinishLoading callback we are starting another
fetch using another connection. This second fetch just hangs and never
completes. I'm guessing that NSURLConnection won't call a delegate (or
perhaps even start the fetch) when it's already calling another one.
To start "another fetch using another connection", you should create another
NSURLConnection
I am.
Is
this the case? If so, I'll need to manage my own completion queue, which
I was hoping I didn't need to do on Mac.
In the "Class Description" of the NSURLConnection documentation:
Unless a NSURLConnection receives a cancel message, the delegate will
receive one and only one of connectionDidFinishLoading:, or
connection:didFailWithError: message, but never both. In addition, once
either of messages are sent, the delegate will receive no further messages
for the given NSURLConnection.
I know. I am starting a new connection and attempting to run it from the
completion proc of another one. The trick is, we have to do it
'synchronously' so we end up not leaving the current invocation of the
run loop. In this situation, we get stuck. We try to fake synchronicity
by running the run loop until the request is complete. I would use the
sync call but we need to handle things like redirection, etc (or rather,
*stop* redirection, etc.) which requires the use of a delegate, which
can only be used async.
-- Ed
_______________________________________________
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