Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Alternative to bootstrap_register?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Alternative to bootstrap_register?



On 18 Nov 2009, at 15:22, Jean-Daniel Dupas wrote:

[snip]

> First case:
> 	Parent process create a receive right using [NSMachPort port].
> 	It register it using an UUID string as the name for example using -[NSMachBootstrapServer registerPort:name:].
> 	It starts a child process passing it the service name as argument (or using env variable).
> 	The child process get a send right using the -[NSMachBootstrapServer portForName:] method
>
> 	Your Mach channel is up.

[snip]

> Second case. You want to have a send right on a child process.
>
> 	Parent process register a service using launchd API (and pass an UUID string as service name).
> 	Parent query a send right using bootstrap_lookup. -> launchd start the child process.
> 	Child process retrieves the receive right using the launchd API.
>
> 	 Your Mach channel is up.
>
> If you need this configuration (child has receive right, parent has send right), an other way is to use method 1 and then the child process can create a port and send a send right to the parent using the first mach channel.

Another alternative is just to use bootstrap_checkin() from the child process, and then you can use the port that that API returns.  The parent would then use bootstrap_look_up().

(That's what my sample program does.)

Kind regards,

Alastair.

--
http://alastairs-place.net



 _______________________________________________
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: 
 >Alternative to bootstrap_register? (From: Uli Kusterer <email@hidden>)
 >Re: Alternative to bootstrap_register? (From: Jean-Daniel Dupas <email@hidden>)
 >Re: Alternative to bootstrap_register? (From: Uli Kusterer <email@hidden>)
 >Re: Alternative to bootstrap_register? (From: Jean-Daniel Dupas <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.