---
title: "connect(endpoint:streamingProvider:)"
framework: foveatedstreaming
role: symbol
role_heading: Instance Method
path: "foveatedstreaming/foveatedstreamingsession/connect(endpoint:streamingprovider:)"
---

# connect(endpoint:streamingProvider:)

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

## Declaration

```swift
@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

Discussion This overload allows you to explicitly specify which streaming provider extension to use. note: FoveatedStreamingSession.DisconnectReason if the connection fails, or CancellationError if the task is cancelled.
