• 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
Using CFFTPStream outside of the default run loop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using CFFTPStream outside of the default run loop


  • Subject: Using CFFTPStream outside of the default run loop
  • From: "R. Tyler Ballance" <email@hidden>
  • Date: Thu, 15 Feb 2007 07:36:13 -0600

Howdy, 

I've got a set of code that requires me to make an upload to an FTP site inside the NSModalPanelRunLoopMode, which is making things all sorts of fun :)

Currently I'm using CURLHandle, but it's far to basic as we need to do both uploads and deletions, along with atomic progress updates to the displayed NSProgressIndicator. I've tried ConnectionKit, but that's so geared towards async IO on the application's default run loop, I couldn't get it to work for the life of me inside my modal panel's run loop.

"Ideally" I would like to modify the CFFTPSample code (http://developer.apple.com/samplecode/CFFTPSample/) to operate from within my NSThread detached inside the modal panel run loop. After my initial attempt I found that the CFWriteStream callback (for handling the has-bytes events, etc) was never being called. 

I'm relatively certain that calling: CFWriteStreamScheduleWithRunLoop(writeStream, CFRunLoopGetCurrent(), kCFRunLoopCommonModes);
should be scheduling the stream events on the modal panel's runloop, but stepping through the code shows that the first function (in this case MySimpleUpload()) returns immediately and the stream events never seem to be scheduled on the current run loop.

CFRunLoopGetCurrent() will report the thread's or the modal panel's runloop correct? Are there any caveats I should know about for trying to schedule events on a "special" run loop? I should just be able to schedule those CFWriteStream events on my modal panel and then let CFRunLoopRun() correct?

I'm asking more for validation before I rip out this current network code in favor of a more CFNetwork alternative (this will mark the third time this code has been rewritten -_-)


Suggestions welcome :)


Cheers
R. Tyler Ballance: Lead Mac Developer at bleep. software
contact: email@hidden | jabber: email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Using CFFTPStream outside of the default run loop
      • From: Frederick Cheung <email@hidden>
  • Prev by Date: Re: How to use CFFTP API to get current working directory
  • Next by Date: Re: Using CFFTPStream outside of the default run loop
  • Previous by thread: Re: How to use CFFTP API to get current working directory
  • Next by thread: Re: Using CFFTPStream outside of the default run loop
  • Index(es):
    • Date
    • Thread