---
title: "xpc_connection_get_context(_:)"
framework: xpc
role: symbol
role_heading: Function
path: "xpc/xpc_connection_get_context(_:)"
---

# xpc_connection_get_context(_:)

Returns the context for the connection.

## Declaration

```swift
func xpc_connection_get_context(_ connection: xpc_connection_t) -> UnsafeMutableRawPointer?
```

## Parameters

- `connection`: The connection which is to be examined.

## Return Value

Return Value The context associated with the connection. NULL if there has been no context associated with the object.

## See Also

### Context

- [xpc_connection_set_context(_:_:)](xpc/xpc_connection_set_context(_:_:).md)
- [xpc_connection_set_finalizer_f(_:_:)](xpc/xpc_connection_set_finalizer_f(_:_:).md)
- [xpc_finalizer_t](xpc/xpc_finalizer_t.md)
