https://github.com/inokinoki/macosxpcsample
Test Use Cases of XPC (Cross Process Communication) on macOS
https://github.com/inokinoki/macosxpcsample
Last synced: about 1 year ago
JSON representation
Test Use Cases of XPC (Cross Process Communication) on macOS
- Host: GitHub
- URL: https://github.com/inokinoki/macosxpcsample
- Owner: Inokinoki
- Created: 2020-09-26T14:04:54.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-05-29T19:59:42.000Z (about 5 years ago)
- Last Synced: 2025-02-09T08:33:43.899Z (over 1 year ago)
- Language: Objective-C
- Size: 55.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# XPC demo application on macOS - embedded
The word `embedded` means that the XPC service will be included in the `.app` bundle.
## Objective-C
[XPCCallerUIOBC](XPCCallerUIOBC) is a demo in full Objective-C, with a XPC caller (client) GUI program and an embedded XPC callee (server).
## Swift
[XPCCallerUITest](XPCCallerUITest) is a demo in full Swift, with a XPC caller (client) GUI program and an embedded XPC callee (server).
It's directly called UI Test, because Swift is more widely used at this era :)
## [WIP] Hybrid
[XPCCallerSwift](XPCCallerSwift) is a demo which does not work at the moment. This is a demo where a Swift cli calls XPC on a XPC Service.
At least I can confirm that, a cli program cannot embed a XPC service thus cannot call one.
TODO:
- validate whether Swift and Objective-C XPC can call each other. I've ever met a reply data corruption, probably due to the different signature in Swift and Objective-C.
## C API
[XPCCallerCAPI](XPCCallerCAPI) is a demo in Objective-C, the XPC is implemented with the system C API.
# XPC demo application on macOS - Mach
Mach means that the call is through launchd, with MIG mechanism.
## Swift
[MachSwift](MachSwift) is a demo in full Swift, with a XPC caller program and an external XPC callee based on launchd and Mach MIG.
## C API
[MachC](MachC) is a demo in Objective-C/C, with a XPC caller program and an external XPC callee based on launchd and Mach MIG.
It does not work well - the received Mach message seems to be corrupted. Need fix...