From f226a95d561a0847fe9628543c6d19f2c7b351db Mon Sep 17 00:00:00 2001 From: Hiroshi Horie <548776+hiroshihorie@users.noreply.github.com> Date: Fri, 3 Jan 2025 03:28:42 +0900 Subject: [PATCH] Rename option --- Sources/LiveKit/Support/WebSocket.swift | 2 +- Sources/LiveKit/Types/Options/ConnectOptions.swift | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/LiveKit/Support/WebSocket.swift b/Sources/LiveKit/Support/WebSocket.swift index 88d00ec42..95ebce04a 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?.connectTimeoutInterval ?? .defaultSocketConnect) + timeoutInterval: connectOptions?.socketConnectTimeout ?? .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 c9845cd87..8788ce043 100644 --- a/Sources/LiveKit/Types/Options/ConnectOptions.swift +++ b/Sources/LiveKit/Types/Options/ConnectOptions.swift @@ -34,7 +34,7 @@ public final class ConnectOptions: NSObject, Sendable { /// The timeout interval for the room connection. @objc - public let connectTimeoutInterval: TimeInterval + public let socketConnectTimeout: TimeInterval @objc public let primaryTransportConnectTimeout: TimeInterval @@ -58,7 +58,7 @@ public final class ConnectOptions: NSObject, Sendable { autoSubscribe = true reconnectAttempts = 3 reconnectAttemptDelay = .defaultReconnectAttemptDelay - connectTimeoutInterval = .defaultSocketConnect + socketConnectTimeout = .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.connectTimeoutInterval = connectTimeoutInterval + self.socketConnectTimeout = 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 && - connectTimeoutInterval == other.connectTimeoutInterval && + socketConnectTimeout == other.socketConnectTimeout && 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(connectTimeoutInterval) + hasher.combine(socketConnectTimeout) hasher.combine(primaryTransportConnectTimeout) hasher.combine(publisherTransportConnectTimeout) hasher.combine(iceServers)