Use CFMessagePort in CFM app?
Use CFMessagePort in CFM app?
- Subject: Use CFMessagePort in CFM app?
- From: "Jan E. Schotsman" <email@hidden>
- Date: Tue, 8 Jun 2004 05:36:28 -0400
Hello,
I am beginning to feel I am trying to do the impossible (using message
ports in a CFM app).
I want to use the ports to communicate with a helper tool (which basically
calls MovieExportFromDataRefToProcedures in its main thread because some
QuickTime copmonents, notably sound components, are not thread safe yet).
I can load all the function pointers from CoreFoundation framework, no
problem there.
Calling CFMessagePortCreateLocal and CFMessagePortCreateLocal in an MP
thread seems to work.
I don't know what kCFRunLoopDefaultMode is, right now I m just guessing
CFSTR("").
Next problem is my port callbacks are never called. Is this a UPP-like
problem? Can I write some glue to make it work or is this a no-no?
The callbacks look like:
CFDataRef myPortMessageHandler( CFMessagePortRef /*local*/, SInt32
messageID, CFDataRef data, void *info )
{
// Cast info to my info
#if DPRINTING
dprintf( "Received message on client port\n" );
#endif
switch ( messageID )
{
case kDE_ServerMessageTypeOpen:
// Signal that server port is ready.
error = MPSignalSemaphore(
serverPortOpenSemaphore );
break;
case kDE_ServerMessageTypeFrameCompressed:
// Handle message
break;
case kDE_ServerMessageTypeClose:
// Handle message
break;
}
return nil;
}
Getting desperate,
Jan.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.