Skip to content

Commit 224b228

Browse files
Increase parallel connection limit for iOS
Default number of parallel connection per host is 6 for hardware iOS device. This limits the speed of network stages of map download and map update. Increase this limit to 32 connections. Relates-To: HERESDK-5947 Signed-off-by: Mykhailo Diachenko <ext-mykhailo.z.diachenko@here.com>
1 parent ee1ca35 commit 224b228

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

olp-cpp-sdk-core/src/http/ios/OLPHttpClient.mm

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
namespace {
3333
constexpr auto kLogTag = "OLPHttpClient";
34+
constexpr auto kMaximumConnectionPerHost = 32;
3435

3536
using SessionId = std::uint64_t;
3637
static SessionId sessionIdCounter_ = std::numeric_limits<SessionId>::min() + 1;
@@ -60,7 +61,7 @@ void OnExitBackground() override {
6061

6162
} // namespace
6263

63-
@interface OLPHttpClient ()<NSURLSessionDataDelegate>
64+
@interface OLPHttpClient () <NSURLSessionDataDelegate>
6465

6566
@property(nonatomic) NSMutableDictionary* tasks;
6667

@@ -87,8 +88,9 @@ - (instancetype)init {
8788
_delegateQueue = [[NSOperationQueue alloc] init];
8889
_delegateQueue.name = @"com.here.olp.network.HttpClientSessionQueue";
8990

90-
_sharedUrlSession =
91-
[self urlSessionWithProxy:nil andHeaders:nil andBackgroundId:nil];
91+
_sharedUrlSession = [self urlSessionWithProxy:nil
92+
andHeaders:nil
93+
andBackgroundId:nil];
9294

9395
_sharedUrlBackgroundSession =
9496
[self urlSessionWithProxy:nil
@@ -673,6 +675,8 @@ - (NSURLSession*)urlSessionWithProxy:(NSDictionary*)proxyDict
673675
config = [NSURLSessionConfiguration ephemeralSessionConfiguration];
674676
}
675677

678+
config.HTTPMaximumConnectionsPerHost = kMaximumConnectionPerHost;
679+
676680
if (proxyDict) {
677681
config.connectionProxyDictionary = proxyDict;
678682
}

0 commit comments

Comments
 (0)