Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Launchd and domain sockets, accept() problem (was Re: launchd APIs)



On Apr 25, 2006, at 1:21 PM, Kevin Brock wrote:

The comment in the header says that calling launch_msg() with no message is a way to receive asynchronous messages. Polling this seems clunky... Is there a way to register a callback for asynchronous messages?

Yes, that's what launch_get_fd() is for.

I'm not sure I see how this works. In the header, launch_get_fd takes no arguments, so I can't use it to register a callback. It looks as though, if I call it at the right time, it will return a file descriptor. It's not clear what context it should be called in, or what fiel descriptor it will return... It *does* look as though I have to poll it.

The idea is that you add that FD to your event loop (select(),poll (),kqueue...) along with all your normal work. When that FD becomes readable, then call launch_msg(NULL) in a loop until it returns NULL and errno == 0.


But this is really not very interesting to talk about, since nothing in launchd actually vends asynchronous messages right now, and honestly, given the way launchd is evolving, nothing may in the future either. It was something we added because we thought we might use it, but reality isn't panning out that way. Shrug.

davez
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden
References: 
 >launchd APIs (From: Kevin Brock <email@hidden>)
 >Re: launchd APIs (From: Dave Zarzycki <email@hidden>)
 >Launchd and domain sockets, accept() problem (was Re: launchd APIs) (From: Kevin Brock <email@hidden>)
 >Re: Launchd and domain sockets, accept() problem (was Re: launchd APIs) (From: Dave Zarzycki <email@hidden>)
 >Re: Launchd and domain sockets, accept() problem (was Re: launchd APIs) (From: Kevin Brock <email@hidden>)
 >Re: Launchd and domain sockets, accept() problem (was Re: launchd APIs) (From: Dave Zarzycki <email@hidden>)
 >Re: Launchd and domain sockets, accept() problem (was Re: launchd APIs) (From: Kevin Brock <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.