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

# connect(endpoint:streamingProvider:)

Establishes a streaming connection at the provided endpoint using the specified streaming provider.

```
@MainActor final func connect(endpoint: FoveatedStreamingSession.Endpoint = .systemDiscovered, streamingProvider: FoveatedStreamingSession.StreamingProvider) async throws
```

## Parameters

`endpoint`

The endpoint to connect to (local IP, remote URL, or system-discovered).

`streamingProvider`

The specific streaming provider to use for this connection.

## Discussion

This overload allows you to explicitly specify which streaming provider extension to use.

> Throws: ``doc://com.apple.FoveatedStreaming/documentation/FoveatedStreaming/FoveatedStreamingSession/DisconnectReason`` if the connection fails, or `CancellationError` if the task is cancelled.

---

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)