<!--
{
  "availability" : [
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FoveatedStreaming",
  "identifier" : "/documentation/FoveatedStreaming/FoveatedStreamingExtension/connect(context:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foveated Streaming"
    ],
    "preciseIdentifier" : "s:17FoveatedStreaming0aB9ExtensionP7connect7contextyAA0aB15ProviderContextC_tYaKF"
  },
  "title" : "connect(context:)"
}
-->

# connect(context:)

Connect to the provided endpoint.

```
@MainActor func connect(context: Self.Context) async throws
```

## Parameters

`context`

An object used to communicate state back to the host app.

## Discussion

This is called when the session begins.
Your extension should begin connecting to `context.endpoint` immediately.

> Throws: If the connection fails.  The error will be presented to the host app.

---

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)