Skip to content

Commit

Permalink
Replace hardcoded realtime request timeout.
Browse files Browse the repository at this point in the history
  • Loading branch information
tcard committed Apr 27, 2016
1 parent 99aa8c0 commit 0aa8cb6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/ARTRealtime.m
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ - (void)ping:(void (^)(ARTErrorInfo *)) cb {
return;
}
case ARTRealtimeConnected:
[_pingEventEmitter timed:[_pingEventEmitter once:cb] deadline:10.0 onTimeout:^{
[_pingEventEmitter timed:[_pingEventEmitter once:cb] deadline:[ARTDefault realtimeRequestTimeout] onTimeout:^{
cb([ARTErrorInfo createWithCode:0 status:ARTStateConnectionFailed message:@"connection failed"]);
}];
[self.transport sendPing];
Expand Down Expand Up @@ -249,7 +249,7 @@ - (void)transition:(ARTRealtimeConnectionState)state withErrorInfo:(ARTErrorInfo
break;
}
case ARTRealtimeClosing: {
[self unlessStateChangesBefore:10.0 do:^{
[self unlessStateChangesBefore:[ARTDefault realtimeRequestTimeout] do:^{
[self transition:ARTRealtimeClosed];
}];
[self.transport sendClose];
Expand Down

0 comments on commit 0aa8cb6

Please sign in to comment.