NSRunLoop vs. CFRunLoop
NSRunLoop vs. CFRunLoop
- Subject: NSRunLoop vs. CFRunLoop
- From: Fritz Anderson <email@hidden>
- Date: Mon, 28 Oct 2002 16:52:36 -0600
Work (if one calls it that while unemployed) has taken me into
registering callbacks in a CFRunLoop in a Cocoa application.
When I test my code in a Cocoa command-line tool (in which
NSApplication is not run, mark you), I find that CFRunLoopRun() does
not return, unless I call CFRunLoopStop() in the callback, even if I
call CFReadStreamClose() and CFHTTPReadStreamUnscheduleFromRunLoop() --
henceforth C35p() -- on its only registered input. My previous
experience was with -[NSRunLoop run], which ordinarily does return
whenever it runs out of inputs and tasks.
There are two possibilities.
One, that the return from [NSThread run] is behavior added by NSThread,
and I should add it myself if I want it. Is this the case?
Or, two, and more likely, I don't understand how to kill and unregister
a CFHTTPReadStream.
The C35p() call is for a CFHTTPReadStream that has been registered with
a callback through an API that looks a lot like the one for registering
a CFRunLoopSource. I therefore assume I don't need to call any
CFRunLoopSource functions to unschedule or invalidate the stream. Is
that inference correct? (And if it is, could that be made clear in the
comments or the documents?)
-- F
--
Fritz Anderson - Consulting Programmer - Chicago, IL
Mail: <email@hidden>
Risumi: <
http://resume.manoverboard.org>
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.