Contents

xpc_connection_activate(_:)

Activates a new connection.

Declaration

func xpc_connection_activate(_ connection: xpc_connection_t)

Discussion

Connections start in an inactive state, so you must call xpc_connection_activate(_:) on a connection before it will send or receive any messages.

Calling xpc_connection_activate(_:) on an active connection has no effect. Releasing the last reference on an inactive connection that was created with a call to one of the xpc_connection_create functions is undefined.

For backward compatibility reasons, xpc_connection_resume(_:) on an inactive and not otherwise suspended XPC connection has the same effect as calling xpc_connection_activate(_:). For new code, using xpc_connection_activate(_:) is preferred.

See Also

Life cycle