Starting multiple instances of the same XPC service (NSXPCConnection)

Is it possible to run multiple instances of the same XPC service using the XPC APIs found in Foundation.framework ( NSXPCConnectionetc.)? docs do not give much understanding of this issue.

EDIT . A quick test passed, and it seems that only one instance of the service is working, although I created two XPC connections. Is there a way to start another instance?

+13
source share
5 answers

I believe XPC services are designed for a single instance for multiple connections. It may be more convenient to manage named pipes with one executable executable. Thus, it is most likely impossible to create multiple instances at the same time.

+1
source

A bit late, but the final answer to this question is presented in the xpcservice.plist manpage :

ServiceType (default: application)

The XPC service type indicates how the service instance is created. Values:

• Application: each application will have a unique instance of this service.

• User: one instance of the service process is created for each user.

• : . XPC root.

: XPC , ( , ), ( ).

+8

XPC , , :

XPC , , , , ( SIGKILL), . , , , , . , XPC , startd. XPC , , . , .

- XPC

xpc , .

0
0

I know I'm late for the party, but so far you can’t do it with a simple XPC, there is a library (OpenEmu component) that should be able to do what you ask for: OpenEmuXPCCommunicator

0
source

Source: https://habr.com/ru/post/1529337/


All Articles