• 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: Mac OS Leopard: how to spawn an child "application"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mac OS Leopard: how to spawn an child "application"?


  • Subject: Re: Mac OS Leopard: how to spawn an child "application"?
  • From: Nick <email@hidden>
  • Date: Sat, 11 Jun 2011 19:59:13 +0300

Ken,
i have an agent and a corresponding per-agent process (this per-agent
process, apart from doing its main job and displaying gui when its clicked,
displays an icon in dock which can change colors).  Of course, the agent is
spawned for every logged in user.
I found parent-child connected (socketpair) sockets/pipes to be the easiest
way to set up a conversation between an agent and that peruser application
in Dock.  And in Snow Leopard it works.

This "per user" idea does not let me use any advertisement-based  IPCs (like
user domain sockets or bonjour). I need some "per user only" IPC - so other
user's instance of the process does  not interfere with the current user's
one.

I've heard that Mach Ports can be set to be seen only in the current login
session (i.e., by current user's apps), but search led me to conclusion this
is rather a messy/few documented (for usermode applications) topic and it
behaves differently  for Leopard and Snow Leopard due to some changes in
"bootstrap context"

2011/6/11 Ken Thomases <email@hidden>

> On Jun 11, 2011, at 10:32 AM, Nick wrote:
>
> Why do you care if it's the parent?  What feature(s) of the parent-child
> relationship is (are) important?  Maybe what you're trying to achieve can be
> accomplished in some other manner while still using NSWorkspace or Launch
> Services to launch the application (which is the right way).
>
> If it's just inter-process communication, there are other options.  For
> example, use Bonjour for the parent to advertise its service and for the
> child to find and connect to it.  Or use Unix domain sockets with a path
> that is known to both.  Using Launch Services, you can pass an Apple Event
> descriptor with additional parameter information, which the child can
> retrieve.  (The methods of NSWorkspace claim to support this, but I've found
> them to be buggy in this regard.)  Etc.
>
> Regards,
> Ken
>
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Mac OS Leopard: how to spawn an child "application"?
      • From: Ken Thomases <email@hidden>
    • Re: Mac OS Leopard: how to spawn an child "application"?
      • From: Kyle Sluder <email@hidden>
References: 
 >Mac OS Leopard: how to spawn an child "application"? (From: Nick <email@hidden>)
 >Re: Mac OS Leopard: how to spawn an child "application"? (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: Mac OS Leopard: how to spawn an child "application"?
  • Next by Date: Re: Mac OS Leopard: how to spawn an child "application"?
  • Previous by thread: Re: Mac OS Leopard: how to spawn an child "application"?
  • Next by thread: Re: Mac OS Leopard: how to spawn an child "application"?
  • Index(es):
    • Date
    • Thread