• 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
CFNetwork Run Loop question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CFNetwork Run Loop question


  • Subject: CFNetwork Run Loop question
  • From: Bob Sabiston <email@hidden>
  • Date: Fri, 4 Mar 2005 12:59:56 -0600

Hello,

I just subscribed to this list. I am bumbling through the setup of a CFWriteStream to write to an FTP URL. I have everything set up, but it isn't working. My CallBack never gets called. Perhaps someone can help me?

I am trying to use the whole Client Setup/Callback/RunLoop thing to write my data asynchronously. Earlier, I used the sample code successfully to write it synchronously, without using the callbacks. However, now that I am trying to use callbacks and runloops, it isn't working.

First I create my WriteStream. I set the FTP username and password properties. Then I set up the callback:

CFOptionFlags streamEvents = kCFStreamEventNone|kCFStreamEventOpenCompleted|kCFStreamEventCanAcceptBy tes|kCFStreamEventErrorOccurred;

ok = CFWriteStreamSetClient(myWriteStream, streamEvents, MyCallBack,NULL);

CFRunLoopRef runLoop = (CFRunLoopRef)GetCFRunLoopFromEventLoop(mainLoop);
CFWriteStreamScheduleWithRunLoop(myWriteStream, runLoop, kCFRunLoopDefaultMode);


	if (!CFWriteStreamOpen(myWriteStream)) {
		// error checking
	}

I wasn't sure about getting the CFRunLoopRef from my main Carbon Loop. That GetCFRunLoopFromEventLoop returns a type other than a CFRunLoopRef, so I just recast it. Could that be my problem?

The problem is, the callback doesn't seem to get called. And that is where my write code is.

Thanks for any suggestions!
Bob

_______________________________________________
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: CFNetwork Run Loop question
      • From: Quinn <email@hidden>
  • Prev by Date: Re: Abandonment of AppleTalk?
  • Next by Date: how to create new directories in an FTP account
  • Previous by thread: I'm trying to adjust the TCP window scale option...
  • Next by thread: Re: CFNetwork Run Loop question
  • Index(es):
    • Date
    • Thread