Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yes, that is possible, but not the way you'd expect.</p> <p>You can <strong>not</strong> have a (non launchd) process vend a service. That is for security reasons, since it would make it easy to do man-in-the-middle attacks.</p> <p>You can still achieve what you want, though: You have to set up a launchd service that vends an XPC / mach service. Both process A and B then connect to your launchd service. Process A can then create a so called <strong>anonymous connection</strong> and send that to the launchd service which will forward it to process B. Once that has happened, processes A and B can talk to each other directly through that connection (i.e. the launchd service can exit without the connection breaking).</p> <p>This may seem round-about, but it's necessary for security reasons.</p> <p>See the <code>xpc_object(3)</code> man page for details about anonymous connections.</p> <p>It's a bit counter intuitive, because process A will create a <em>listener</em> object with <code>xpc_connection_create()</code>. A then creates an <em>endpoint</em> object from the listener with <code>xpc_endpoint_create()</code> and sends that endpoint across the wire (over XPC) to process B. B can then turn that object into a connection with <code>xpc_connection_create_from_endpoint()</code>. A's event handler for the <em>listener</em> will then receive a connection object matching the connection that B created with <code>xpc_connection_create_from_endpoint()</code>. This works similar to the way that the event handler of <code>xpc_connection_create_mach_service()</code> will receive connection objects when clients connect.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload