• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: External kill of an NSThread?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: External kill of an NSThread?
      • From: Murat Konar <email@hidden>
References: 
 >External kill of an NSThread? (From: Roland Torres <email@hidden>)
 >Re: External kill of an NSThread? (From: John Stiles <email@hidden>)
 >Re: External kill of an NSThread? (From: Filipe Varela <email@hidden>)
 >Re: External kill of an NSThread? (From: Roland Torres <email@hidden>)
 >Re: External kill of an NSThread? (From: Murat Konar <email@hidden>)
 >Re: External kill of an NSThread? (From: Roland Torres <email@hidden>)
 >Re: External kill of an NSThread? (From: Murat Konar <email@hidden>)
 >Re: External kill of an NSThread? (From: Roland Torres <email@hidden>)
 >Re: External kill of an NSThread? (From: Murat Konar <email@hidden>)

  • Prev by Date: Re: External kill of an NSThread?
  • Next by Date: Re: Questions for implementing pop-up contextual menus for Ctrl-Click and Right-Click
  • Previous by thread: Re: External kill of an NSThread?
  • Next by thread: Re: External kill of an NSThread?
  • Index(es):
    • Date
    • Thread