• 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
Stopping an NSThread (or something similar)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Stopping an NSThread (or something similar)


  • Subject: Stopping an NSThread (or something similar)
  • From: Michael Becker <email@hidden>
  • Date: Fri, 14 Jul 2006 03:35:54 +0200

Sorry for the forwarding, I used the wrong e-mail account to send this e-mail before...

Anfang der weitergeleiteten E-Mail:
Hi,

my application is designed to upload files via an HTTP POST request. I am using libcurl to do this, as libcurl allows me to monitor the upload progress (which NSURLConnection obviously does not). However, I am having a problem: Naturally, I want the user to be able to click a button to immediately stop the upload. I am uploading the files in a secondary thread. If I use the good ol' technique that's using a BOOL variable to tell the secondary thread to stop, this won't work properly as the thread will only be able to check the variable between file uploads. So if the user triggers a 10 MB upload and wants to stop that, they will have to wait until the 10 MBs are uploaded before the thread stops.

The thing is, that I cannot interfere with the uploading (I guess). I simply call "curl_easy_perform()" and off it goes. The problem I've posted here to me seems to be one of the more fundamental "things-everybody-needs". E.g., Safari allows you to stop the download of files, too. So does more or less any networking application I can think of right now.

How are they doing that?

Regards,
Michael

PS: Remember: I am talking about UPloading files. DOWNloading actually seems to be supported very well and boasting any feature you'd ever wish for...

_______________________________________________ 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
  • Follow-Ups:
    • Re: Stopping an NSThread (or something similar)
      • From: Chris Suter <email@hidden>
    • Re: Stopping an NSThread (or something similar)
      • From: Nir Soffer <email@hidden>
  • Prev by Date: Re: DVDPlayback
  • Next by Date: [Moderator] Re: DVDPlayback
  • Previous by thread: NSTextView - suppress insertion point drawing from delegate?
  • Next by thread: Re: Stopping an NSThread (or something similar)
  • Index(es):
    • Date
    • Thread