← XPC

xpc_listener_t

XPC Dokümantasyonu

Type Alias | XPC

A C type that performs tasks for clients across process boundaries.

typealias xpc_listener_t = OS_xpc_listener

To implement an XPC service, create a listener and respond to incoming session requests.


Creating a listener

Working with code signing

See Also

Interprocess communication


xpc_listener_incoming_session_handler_t

Type Alias | XPC

A block that receives an incoming peer session request from a client.

typealias xpc_listener_incoming_session_handler_t = (xpc_session_t) -> Void

When a client connects to your service, the system invokes this block with a session that represents the server’s connection to the client. Before returning from this block, you must do one of the following:

Important: Failure to take one of these actions results in an API misuse crash.

When the incoming_session_handler returns, the system automatically activates the peer session unless you explicitly cancel it.


xpc_listener_set_peer_code_signing_requirement(_:_:)

Function | XPC

func xpc_listener_set_peer_code_signing_requirement(_ listener: xpc_listener_t, _ requirement: UnsafePointer<CChar>) -> Int32