Re: External kill of an NSThread?
Re: External kill of an NSThread?
- Subject: Re: External kill of an NSThread?
- From: Roland Torres <email@hidden>
- Date: Tue, 21 Nov 2006 18:19:32 -0800
On Nov 21, 2006, at 5:29 PM, Murat Konar wrote:
On Nov 21, 2006, at 3:46 PM, Roland Torres wrote:
Depends on what is wrong. There are many ways a URL can be
"invalid". It might not conform to the URL spec, the host
specified in the URL might not exist or be reachable, the
resource pointed to by the URL might not exist, etc.
By "invalid" I just mean that the URL doesn't exist or is
inaccessible. If I could validate the URL before calling the 3rd
party library, then I would be able to avoid the whole thing
hanging. Sadly, Cocoa objects that use -initWithContentsOfURL:
just hang forever on URLs they can't access,
Are you sure? I just tried [NSData dataWithContentsOfURL:url], and
I couldn't get it to hang. Feeding it a URL to a non-existent host
just results in an NSData object with zero length.
Here's my test app. <http://muratnkonar.com/source-code/URLTest.zip>
Interesting. You're quite right for invalid URLs, it returns
immediately. But try entering an inaccessible URL like "http://
192.168.0.20" in your little app. It hangs on this for me for about
1min 15secs, but it does come back eventually. This might be
salvagable if there's a way to shorten the wait time.
Thanks,
Roland
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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