All Projects → google → macops-MOLXPCConnection

google / macops-MOLXPCConnection

Licence: other
An NSXPCConnection wrapper that does signature validation

Programming Languages

objective c
16641 projects - #2 most used programming language
Starlark
911 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to macops-MOLXPCConnection

Kalm.js
The socket manager
Stars: ✭ 155 (+638.1%)
Mutual labels:  ipc
procbridge
A super-lightweight IPC (Inter-Process Communication) protocol over TCP socket.
Stars: ✭ 118 (+461.9%)
Mutual labels:  ipc
libvarlink
C implementation of the Varlink protocol and command line tool
Stars: ✭ 78 (+271.43%)
Mutual labels:  ipc
Andromeda
Andromeda simplifies local/remote communication for Android modularization
Stars: ✭ 2,203 (+10390.48%)
Mutual labels:  ipc
Iceoryx
iceoryx - true zero-copy inter-process-communication
Stars: ✭ 208 (+890.48%)
Mutual labels:  ipc
wat
How fast are computers?
Stars: ✭ 26 (+23.81%)
Mutual labels:  ipc
Jstp
Fast RPC for browser and Node.js based on TCP, WebSocket, and MDSF
Stars: ✭ 132 (+528.57%)
Mutual labels:  ipc
reactor-aeron
A reactive driver for Aeron transport (https://github.com/real-logic/aeron)
Stars: ✭ 43 (+104.76%)
Mutual labels:  ipc
Tosdatabridge
A collection of resources for pulling real-time streaming data off of TDAmeritrade's ThinkOrSwim(TOS) platform; providing C, C++, Java and Python interfaces.
Stars: ✭ 229 (+990.48%)
Mutual labels:  ipc
background-service-lib
Essential classes for reliable background services.
Stars: ✭ 24 (+14.29%)
Mutual labels:  ipc
Chromium Ipc Sniffer
A tool to capture communication between Chromium processes on Windows
Stars: ✭ 197 (+838.1%)
Mutual labels:  ipc
Ohsce
PHP HI-REL SOCKET TCP/UDP/ICMP/Serial .高可靠性PHP通信&控制框架SOCKET-TCP/UDP/ICMP/硬件Serial-RS232/RS422/RS485 AND MORE!
Stars: ✭ 206 (+880.95%)
Mutual labels:  ipc
apollo-link-electron
Get GraphQL results over IPC for Electron apps. (WIP)
Stars: ✭ 17 (-19.05%)
Mutual labels:  ipc
Ipcinvoker
A IPC Invoker for Android Development.
Stars: ✭ 176 (+738.1%)
Mutual labels:  ipc
dotnetCampus.Ipc
本机内多进程通讯库
Stars: ✭ 84 (+300%)
Mutual labels:  ipc
Ruby Dbus
A Ruby binding for DBus
Stars: ✭ 142 (+576.19%)
Mutual labels:  ipc
FactoryOrchestrator
A cross-platform system service which provides a simple way to run and manage factory line validation, developer inner-loop, diagnostics, and fault analysis workflows.
Stars: ✭ 36 (+71.43%)
Mutual labels:  ipc
eiphop
A fetch like wrapper for elecron's ipc.
Stars: ✭ 30 (+42.86%)
Mutual labels:  ipc
discoIPC
Connect to the local Discord IPC Socket, for features like Rich Presence.
Stars: ✭ 19 (-9.52%)
Mutual labels:  ipc
persway
Small Sway IPC Daemon
Stars: ✭ 51 (+142.86%)
Mutual labels:  ipc

MOLXPCConnection

A wrapper around NSXPCListener and NSXPCConnection to provide client multiplexing, signature validation of connecting clients, forced connection establishment and different exported interfaces for privileged/unprivileged clients.

Installation

Using CocoaPods

Add the following line to your Podfile:

pod 'MOLCodesignChecker'

Using Bazel

Add the following to your WORKSPACE:

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

# Needed for MOLXPConnection
git_repository(
    name = "MOLCertificate",
    remote = "https://github.com/google/macops-molcertificate.git",
    tag = "v2.0",
)

# Needed for MOLXPCConnection
git_repository(
    name = "MOLCodesignChecker",
    remote = "https://github.com/google/macops-molcodesignchecker.git",
    tag = "v2.0",
)

git_repository(
    name = "MOLXPCConnection",
    remote = "https://github.com/google/macops-molxpcconnection.git",
    tag = "v2.0",
)

And in your BUILD file, add MOLXPCConnection as a dependency:

objc_library(
    name = "MyAwesomeApp_lib",
    srcs = ["src/MyAwesomeApp.m", "src/MyAwesomeApp.h"],
    deps = ["@MOLXPCConnection//:MOLXPCConnection"],
)

Example

Example server started by launchd where the launchd job has a MachServices key:

MOLXPCConnection *conn = [[MOLXPCConnection alloc] initServerWithName:@"MyServer"];
conn.privilegedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MyServerProtocol)];
conn.exportedObject = myObject;
[conn resume];

Example client, connecting to above server:

MOLXPCConnection *conn = [[MOLXPCConnection alloc] initClientWithName:"MyServer" withOptions:0];
conn.remoteInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MyServerProtocol)];
conn.invalidationHandler = ^{ NSLog(@"Connection invalidated") };
[conn resume];

The client can send a message to the server with:

[conn.remoteObjectProxy selectorInRemoteInterface];

One advantage of the way that MOLXPCConnection works over using NSXPCConnection directly is that from the client-side once the resume method has finished, the connection is either valid or the invalidation handler will be called. Ordinarily, the connection doesn't actually get made until the first message is sent across it.

messages are always delivered on a background thread!

Documentation

Reference documentation is at CocoaDocs.org:

http://cocoadocs.org/docsets/MOLXPCConnection

Contributing

Patches to this library are very much welcome. Please see the CONTRIBUTING file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].