File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Sources/ClientRuntime/Config Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -91,13 +91,19 @@ public extension DefaultSDKRuntimeConfiguration {
9191 static func makeClient(
9292 httpClientConfiguration: HttpClientConfiguration = defaultHttpClientConfiguration
9393 ) -> HTTPClient {
94- // TODO -- For testing,revert prior to merge to main
95- #if os(iOS) || os(tvOS) || os(watchOS) || os(visionOS)
94+ #if os(iOS) || os(tvOS) || os(watchOS) || os(visionOS) || os(macOS)
9695 return URLSessionHTTPClient ( httpClientConfiguration: httpClientConfiguration)
9796 #else
98- // TODO -- For testing, revert prior to merge to main
99- // Will be used on Mac and Linux
100- return NIOHTTPClient ( httpClientConfiguration: httpClientConfiguration)
97+ let connectTimeoutMs = httpClientConfiguration. connectTimeout. map { UInt32 ( $0 * 1000 ) }
98+ let socketTimeout = UInt32 ( httpClientConfiguration. socketTimeout)
99+ let config = CRTClientEngineConfig (
100+ maxConnectionsPerEndpoint: httpClientConfiguration. maxConnections,
101+ telemetry: httpClientConfiguration. telemetry ?? CRTClientEngine . noOpCrtClientEngineTelemetry,
102+ connectTimeoutMs: connectTimeoutMs,
103+ crtTlsOptions: httpClientConfiguration. tlsConfiguration as? CRTClientTLSOptions ,
104+ socketTimeout: socketTimeout
105+ )
106+ return CRTClientEngine ( config: config)
101107 #endif
102108 }
103109
You can’t perform that action at this time.
0 commit comments