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

# xpc_connection_create_from_endpoint(_:)

Creates a new connection from the specified endpoint.

## Declaration

```swift
func xpc_connection_create_from_endpoint(_ endpoint: xpc_endpoint_t) -> xpc_connection_t
```

## Parameters

- `endpoint`: The endpoint from which to create the new connection.

## Return Value

Return Value A new peer connection to the listener represented by the given endpoint.

## Discussion

Discussion The same responsibilities of setting an event handler and resuming the connection after calling xpc_connection_create(_:_:) apply to the connection returned by this API. Since the connection yielded by this API is not associated with a name (and therefore is not rediscoverable), this connection will receive XPC_ERROR_CONNECTION_INVALID if the listening side crashes, exits or cancels the listener connection.

## See Also

### Creation

- [xpc_connection_t](xpc/xpc_connection_t.md)
- [xpc_connection_create(_:_:)](xpc/xpc_connection_create(_:_:).md)
- [xpc_connection_create_mach_service(_:_:_:)](xpc/xpc_connection_create_mach_service(_:_:_:).md)
- [xpc_connection_set_target_queue(_:_:)](xpc/xpc_connection_set_target_queue(_:_:).md)
- [XPC_CONNECTION_MACH_SERVICE_LISTENER](xpc/xpc_connection_mach_service_listener.md)
- [XPC_CONNECTION_MACH_SERVICE_PRIVILEGED](xpc/xpc_connection_mach_service_privileged.md)
