site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=alastairs-place.net; h= subject:mime-version:content-type:from:in-reply-to:date:cc: content-transfer-encoding:message-id:references:to; q=dns/txt; s= aug07; bh=bKG99CxCq0/xcE9u3MCi+9jmLQw=; b=UU4ZGxgLfUlKE2mCmvZ0KB ArimpuJOveNAbNHIV5HQ4ruXBkWd0KfvXB7fXHXcSmOwqWXtZ6kIJ2a19qVJSL05 lG+amtD25cUIgOV6JUJhuKyByupMJavdu9azhBMpowhZ5Xe4J6gUgKFs5An7ELc8 o7XQniaE96dGFfnboDf6o= 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 (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com