diff --git a/Sources/LiveKit/Support/WebSocket.swift b/Sources/LiveKit/Support/WebSocket.swift index 95ebce04a..4107cc681 100644 --- a/Sources/LiveKit/Support/WebSocket.swift +++ b/Sources/LiveKit/Support/WebSocket.swift @@ -51,7 +51,7 @@ class WebSocket: NSObject, Loggable, AsyncSequence, URLSessionWebSocketDelegate init(url: URL, connectOptions: ConnectOptions?) async throws { request = URLRequest(url: url, cachePolicy: .useProtocolCachePolicy, - timeoutInterval: connectOptions?.socketConnectTimeout ?? .defaultSocketConnect) + timeoutInterval: connectOptions?.socketConnectTimeoutInterval ?? .defaultSocketConnect) super.init() try await withTaskCancellationHandler { try await withCheckedThrowingContinuation { continuation in diff --git a/Sources/LiveKit/Types/Options/ConnectOptions.swift b/Sources/LiveKit/Types/Options/ConnectOptions.swift index 8788ce043..4698c1c64 100644 --- a/Sources/LiveKit/Types/Options/ConnectOptions.swift +++ b/Sources/LiveKit/Types/Options/ConnectOptions.swift @@ -32,9 +32,9 @@ public final class ConnectOptions: NSObject, Sendable { @objc public let reconnectAttemptDelay: TimeInterval - /// The timeout interval for the room connection. + /// The timeout interval for the initial websocket connection. @objc - public let socketConnectTimeout: TimeInterval + public let socketConnectTimeoutInterval: TimeInterval @objc public let primaryTransportConnectTimeout: TimeInterval @@ -58,7 +58,7 @@ public final class ConnectOptions: NSObject, Sendable { autoSubscribe = true reconnectAttempts = 3 reconnectAttemptDelay = .defaultReconnectAttemptDelay - socketConnectTimeout = .defaultSocketConnect + socketConnectTimeoutInterval = .defaultSocketConnect primaryTransportConnectTimeout = .defaultTransportState publisherTransportConnectTimeout = .defaultTransportState iceServers = [] @@ -80,7 +80,7 @@ public final class ConnectOptions: NSObject, Sendable { self.autoSubscribe = autoSubscribe self.reconnectAttempts = reconnectAttempts self.reconnectAttemptDelay = reconnectAttemptDelay - self.socketConnectTimeout = connectTimeoutInterval + self.socketConnectTimeoutInterval = connectTimeoutInterval self.primaryTransportConnectTimeout = primaryTransportConnectTimeout self.publisherTransportConnectTimeout = publisherTransportConnectTimeout self.iceServers = iceServers @@ -95,7 +95,7 @@ public final class ConnectOptions: NSObject, Sendable { return autoSubscribe == other.autoSubscribe && reconnectAttempts == other.reconnectAttempts && reconnectAttemptDelay == other.reconnectAttemptDelay && - socketConnectTimeout == other.socketConnectTimeout && + socketConnectTimeoutInterval == other.socketConnectTimeoutInterval && primaryTransportConnectTimeout == other.primaryTransportConnectTimeout && publisherTransportConnectTimeout == other.publisherTransportConnectTimeout && iceServers == other.iceServers && @@ -108,7 +108,7 @@ public final class ConnectOptions: NSObject, Sendable { hasher.combine(autoSubscribe) hasher.combine(reconnectAttempts) hasher.combine(reconnectAttemptDelay) - hasher.combine(socketConnectTimeout) + hasher.combine(socketConnectTimeoutInterval) hasher.combine(primaryTransportConnectTimeout) hasher.combine(publisherTransportConnectTimeout) hasher.combine(iceServers)