Contents

accept(incomingMessageHandler:cancellationHandler:)

Accepts an incoming session request from a client using closures to handle received messages or cancellation, and returns the inactive session.

Declaration

@preconcurrency func accept(incomingMessageHandler: @escaping  @Sendable (XPCReceivedMessage) -> (any Encodable)?, cancellationHandler: (@Sendable (XPCRichError) -> Void)? = nil) -> XPCListener.IncomingSessionRequest.Decision

Parameters

  • incomingMessageHandler:

    A closure that receives incoming messages from a client.

  • cancellationHandler:

    An optional closure that the system invokes when it cancels the session.

Return Value

A decision that indicates whether the listener accepts or rejects the incoming session.

See Also

Responding to client sessions requests