From 59a00863105689f154cb3b484ca6f10b64a3645a Mon Sep 17 00:00:00 2001 From: Nicki Stone Date: Tue, 2 Nov 2021 11:09:28 -0700 Subject: [PATCH] fix: set tcp timeout to default (#382) --- .../Sources/Networking/Http/CRT/CRTClientEngine.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Packages/ClientRuntime/Sources/Networking/Http/CRT/CRTClientEngine.swift b/Packages/ClientRuntime/Sources/Networking/Http/CRT/CRTClientEngine.swift index a0dd5b064..dd310fa9d 100644 --- a/Packages/ClientRuntime/Sources/Networking/Http/CRT/CRTClientEngine.swift +++ b/Packages/ClientRuntime/Sources/Networking/Http/CRT/CRTClientEngine.swift @@ -37,7 +37,10 @@ public class CRTClientEngine: HttpClientEngine { logger.error("Server name was not able to be set in TLS Connection Options. TLS Negotiation will fail.") logger.error("Error: \(err.localizedDescription)") } - let socketOptions = SocketOptions(socketType: .stream) + var socketOptions = SocketOptions(socketType: .stream) +#if os(iOS) || os(watchOS) + socketOptions.connectTimeoutMs = 30_000 +#endif let options = HttpClientConnectionOptions(clientBootstrap: SDKDefaultIO.shared.clientBootstrap, hostName: endpoint.host, initialWindowSize: windowSize,