CFNetwork Run Loop question
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