Contents

init(service:targetQueue:options:requirement:incomingSessionHandler:)

Creates a listener with the service defined by the provided name, and requires that the session peer has the specified requirement.

Declaration

@preconcurrency convenience init(service: String, targetQueue: DispatchQueue? = nil, options: XPCListener.InitializationOptions = .none, requirement: XPCPeerRequirement, incomingSessionHandler: @escaping  @Sendable (XPCListener.IncomingSessionRequest) -> XPCListener.IncomingSessionRequest.Decision) throws

Discussion

  • service: The Mach service or XPC Service name to create the listener with.

  • requirement: The requirement the peer must have