---
title: NSXPCConnection
framework: foundation
role: symbol
role_heading: Class
path: foundation/nsxpcconnection
---

# NSXPCConnection

A bidirectional communication channel between two processes.

## Declaration

```swift
class NSXPCConnection
```

## Overview

Overview This class is the primary means of creating and configuring the communication mechanism between two processes. Each process has one instance of this class to represent the endpoint in the communication channel.

## Topics

### Creating a connection

- [init(listenerEndpoint:)](foundation/nsxpcconnection/init(listenerendpoint:).md)
- [init(machServiceName:options:)](foundation/nsxpcconnection/init(machservicename:options:).md)
- [NSXPCConnection.Options](foundation/nsxpcconnection/options.md)
- [init(serviceName:)](foundation/nsxpcconnection/init(servicename:).md)

### Managing connection state

- [activate()](foundation/nsxpcconnection/activate().md)
- [resume()](foundation/nsxpcconnection/resume().md)
- [invalidate()](foundation/nsxpcconnection/invalidate().md)
- [suspend()](foundation/nsxpcconnection/suspend().md)
- [interruptionHandler](foundation/nsxpcconnection/interruptionhandler.md)
- [invalidationHandler](foundation/nsxpcconnection/invalidationhandler.md)
- [current()](foundation/nsxpcconnection/current().md)
- [scheduleSendBarrierBlock(_:)](foundation/nsxpcconnection/schedulesendbarrierblock(_:).md)

### Managing the connection interface

- [serviceName](foundation/nsxpcconnection/servicename.md)
- [endpoint](foundation/nsxpcconnection/endpoint.md)
- [exportedInterface](foundation/nsxpcconnection/exportedinterface.md)
- [exportedObject](foundation/nsxpcconnection/exportedobject.md)
- [remoteObjectInterface](foundation/nsxpcconnection/remoteobjectinterface.md)
- [remoteObjectProxy](foundation/nsxpcconnection/remoteobjectproxy.md)

### Working with security attributes

- [auditSessionIdentifier](foundation/nsxpcconnection/auditsessionidentifier.md)
- [processIdentifier](foundation/nsxpcconnection/processidentifier.md)
- [effectiveGroupIdentifier](foundation/nsxpcconnection/effectivegroupidentifier.md)
- [effectiveUserIdentifier](foundation/nsxpcconnection/effectiveuseridentifier.md)

### Working with proxy objects

- [remoteObjectProxyWithErrorHandler(_:)](foundation/nsxpcconnection/remoteobjectproxywitherrorhandler(_:).md)
- [synchronousRemoteObjectProxyWithErrorHandler(_:)](foundation/nsxpcconnection/synchronousremoteobjectproxywitherrorhandler(_:).md)

### Working with code signing

- [setCodeSigningRequirement(_:)](foundation/nsxpcconnection/setcodesigningrequirement(_:).md)

### Error codes

- [NSXPCConnectionInterrupted](foundation/nsxpcconnectioninterrupted-swift.var.md)
- [NSXPCConnectionInvalid](foundation/nsxpcconnectioninvalid-swift.var.md)
- [NSXPCConnectionReplyInvalid](foundation/nsxpcconnectionreplyinvalid-swift.var.md)
- [NSXPCConnectionErrorMinimum](foundation/nsxpcconnectionerrorminimum-swift.var.md)
- [NSXPCConnectionErrorMaximum](foundation/nsxpcconnectionerrormaximum-swift.var.md)
- [NSXPCConnectionCodeSigningRequirementFailure](foundation/nsxpcconnectioncodesigningrequirementfailure-swift.var.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSXPCProxyCreating](foundation/nsxpcproxycreating.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### XPC Client

- [NSXPCProxyCreating](foundation/nsxpcproxycreating.md)
- [NSXPCInterface](foundation/nsxpcinterface.md)
- [NSXPCCoder](foundation/nsxpccoder.md)
