Skip to content

Commit 9be89d5

Browse files
author
Marshall Chabanga
committed
add connect timeout of 60 seconds
1 parent f8cba88 commit 9be89d5

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

https.android.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

https.android.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ function getClient(reload: boolean = false): okhttp3.OkHttpClient {
144144
console.warn('nativescript-https > Undefined host or certificate. SSL pinning NOT working!!!')
145145
}
146146
}
147+
client.connectTimeout(60,java.util.concurrent.TimeUnit.SECONDS);
147148
Client = client.build();
148149
return Client
149150
}

https.ios.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

https.ios.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function request(options: Https.HttpsRequestOptions): Promise<Https.Https
8888

8989
manager.requestSerializer.allowsCellularAccess = true;
9090
manager.securityPolicy = (policies.secured == true) ? policies.secure : policies.def;
91-
91+
manager.requestSerializer.timeoutInterval = 60;
9292
console.log("nativescript-https: (request) AF Send: ", request);
9393

9494
manager.session.dataTaskWithRequestCompletionHandler(request, function (data: NSData, response: NSHTTPURLResponse, error: NSError) {

0 commit comments

Comments
 (0)