<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "XPC",
  "identifier" : "/documentation/XPC/XPCListener/IncomingSessionRequest/accept(_:)-tkrp",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "XPC"
    ],
    "preciseIdentifier" : "s:3XPC11XPCListenerC22IncomingSessionRequestC6acceptyAE8DecisionVxAA10XPCSessionCXEAA14XPCPeerHandlerRzAA13XPCDictionaryV5InputRtzAM6OutputRtzlF"
  },
  "title" : "accept(_:)"
}
-->

# accept(_:)

Accepts an incoming session request from a client, delegating incoming dictionary messages to a separate object.

```
func accept<Handler>(_ inactiveSessionHandler: (XPCSession) -> Handler) -> XPCListener.IncomingSessionRequest.Decision where Handler : XPCPeerHandler, Handler.Input == XPCDictionary, Handler.Output == XPCDictionary
```

## Parameters

`inactiveSessionHandler`

A closure that receives an inactive incoming session and returns an object to handle messages in the session.

## Return Value

A decision that indicates whether the listener accepts or rejects the incoming session.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)