Skip to content

Commit

Permalink
[CH3478] Use the configured connection timeout (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
arun251 authored May 18, 2017
1 parent c11b215 commit 8b40623
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Darkly/LDClientManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ - (void)startPolling {
[pollingMgr startEventPolling];

if ([config streaming]) {
eventSource = [EventSource eventSourceWithURL:[NSURL URLWithString:kStreamUrl] mobileKey:config.mobileKey];
eventSource = [EventSource eventSourceWithURL:[NSURL URLWithString:kStreamUrl] mobileKey:config.mobileKey timeoutInterval:[config.connectionTimeout doubleValue]];

[eventSource onMessage:^(Event *e) {
[self syncWithServerForConfig];
Expand Down
2 changes: 2 additions & 0 deletions Darkly/LDRequestManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ -(void)performFeatureFlagRequest:(NSString *)encodedUser
requestUrl = [requestUrl stringByAppendingString:encodedUser];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:requestUrl]];
[request setTimeoutInterval:self.connectionTimeout];

[self addFeatureRequestHeaders:request];

Expand Down Expand Up @@ -99,6 +100,7 @@ -(void)performEventRequest:(NSArray *)jsonEventArray
NSString *requestUrl = [eventsUrl stringByAppendingString:kEventUrl];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:requestUrl]];
[request setTimeoutInterval:self.connectionTimeout];
[self addEventRequestHeaders:request];

NSError *error;
Expand Down

0 comments on commit 8b40623

Please sign in to comment.