• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CFSocket with a file descriptor?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: CFSocket with a file descriptor?
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: identifying AppleShare mounts
  • Next by Date: Re: CFSocket with a file descriptor?
  • Previous by thread: identifying AppleShare mounts
  • Next by thread: Re: CFSocket with a file descriptor?
  • Index(es):
    • Date
    • Thread