Re: Launchd and domain sockets, accept() problem (was Re: launchd APIs)
Re: Launchd and domain sockets, accept() problem (was Re: launchd APIs)
- Subject: Re: Launchd and domain sockets, accept() problem (was Re: launchd APIs)
- From: Dave Zarzycki <email@hidden>
- Date: Tue, 25 Apr 2006 14:14:22 -0700
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:
This email sent to email@hidden