From 7a02e335a058abaf60eed7669f792d9e220b8d4b Mon Sep 17 00:00:00 2001 From: "Nelson R. Perez" Date: Wed, 26 Dec 2018 17:47:59 -0500 Subject: [PATCH] Setting write and read timeout to 5 seconds at the NetworkService --- .../java/cy/agorise/graphenej/api/android/NetworkService.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/graphenej/src/main/java/cy/agorise/graphenej/api/android/NetworkService.java b/graphenej/src/main/java/cy/agorise/graphenej/api/android/NetworkService.java index ce9454c..c455688 100644 --- a/graphenej/src/main/java/cy/agorise/graphenej/api/android/NetworkService.java +++ b/graphenej/src/main/java/cy/agorise/graphenej/api/android/NetworkService.java @@ -224,6 +224,8 @@ public class NetworkService extends Service { OkHttpClient client = new OkHttpClient .Builder() .connectTimeout(2, TimeUnit.SECONDS) + .readTimeout(5, TimeUnit.SECONDS) + .writeTimeout(5, TimeUnit.SECONDS) .build(); mSelectedNode = nodeProvider.getBestNode(); Log.v(TAG,"connect.url: "+ mSelectedNode.getUrl()+", latency: "+mSelectedNode.getLatencyValue());