• 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
Re: Launchd and domain sockets, accept() problem (was Re: launchd APIs)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


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>)

  • Prev by Date: Re: Launchd and domain sockets, accept() problem (was Re: launchd APIs)
  • Next by Date: Re: lsof befuddled on 10.4.6?
  • Previous by thread: Re: Launchd and domain sockets, accept() problem (was Re: launchd APIs)
  • Next by thread: jabber- ichat sever
  • Index(es):
    • Date
    • Thread