---
title: "handle(xpcConnection:)"
framework: browserenginekit
role: symbol
role_heading: Instance Method
path: "browserenginekit/renderingextension/handle(xpcconnection:)"
---

# handle(xpcConnection:)

Accepts or rejects an incoming XPC connection.

## Declaration

```swift
func handle(xpcConnection: xpc_connection_t)
```

## Parameters

- `xpcConnection`: The inbound connection.

## Discussion

Discussion When your browser app calls makeLibXPCConnection(), the framework calls this method on your extension, passing the newly created connection as the parameter. To accept the connection, call xpc_connection_set_event_handler(_:_:) to install an event handler and listen for incoming messages. Otherwise, call xpc_connection_cancel(_:) to reject the connection.
