CFSocket with a file descriptor?
CFSocket with a file descriptor?
- Subject: CFSocket with a file descriptor?
- From: Marc Epard <email@hidden>
- Date: Mon, 28 Jul 2003 09:33:40 -0500
I want to use a run loop source callback when there is data available on a
pipe. Is it okay to use a non-socket file descriptor (e.g. STDIN_FILENO)
with a CFSocket? Something like this:
CFSocketRef stdInSocketRef = CFSocketCreateWithNative(NULL,
STDIN_FILENO, kCFSocketReadCallBack,
StdInSocketCallback, &context);
CFRunLoopSourceRef runLoopSource = CFSocketCreateRunLoopSource(NULL,
stdInSocketRef, 0);
CFRunLoopAddSource (CFRunLoopGetCurrent(), runLoopSource,
kCFRunLoopDefaultMode);
void StdInSocketCallback (CFSocketRef s, CFSocketCallBackType type,
CFDataRef address, const void *data, void *info)
{
// Read from STDIN_FILENO here.
}
Will this work at all? What versions of Mac OS X will it work on? Is there
a better way?
-Marc
_______________________________________________
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.