Re: CFNetwork Run Loop question
Re: CFNetwork Run Loop question
- Subject: Re: CFNetwork Run Loop question
- From: Quinn <email@hidden>
- Date: Mon, 7 Mar 2005 11:29:31 +0000
At 12:59 -0600 4/3/05, Bob Sabiston wrote:
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?
Probably not. GetCFRunLoopFromEventLoop returns a CFTypeRef, which
is the 'abstract base class' for all CF types. This means that, in
theory, GetCFRunLoopFromEventLoop could return any CF type. However,
in practice, it should only return a CFRunLoopRef.
You can confirm this using a simple assert.
assert( CFGetTypeID(runLoop) == CFRunLoopGetTypeID() );
This gets the CF type for the runLoop object and checks that it is,
in fact, a CFRunLoop.
The problem is, the callback doesn't seem to get called. And that
is where my write code is.
The #1 reason for runloop callbacks not being called is that you're
not running your runloop. What's your main thread doing while you're
waiting for the callback? If it's blocked doing something else, your
callbacks won't run. OTOH, if you've returned from your event
handler back to the application's main event loop, your callback
should run (and we have to look elsewhere for the problem).
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
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