Setting write and read timeout to 5 seconds at the NetworkService
This commit is contained in:
parent
201d6957f8
commit
7a02e335a0
1 changed files with 2 additions and 0 deletions
|
@ -224,6 +224,8 @@ public class NetworkService extends Service {
|
||||||
OkHttpClient client = new OkHttpClient
|
OkHttpClient client = new OkHttpClient
|
||||||
.Builder()
|
.Builder()
|
||||||
.connectTimeout(2, TimeUnit.SECONDS)
|
.connectTimeout(2, TimeUnit.SECONDS)
|
||||||
|
.readTimeout(5, TimeUnit.SECONDS)
|
||||||
|
.writeTimeout(5, TimeUnit.SECONDS)
|
||||||
.build();
|
.build();
|
||||||
mSelectedNode = nodeProvider.getBestNode();
|
mSelectedNode = nodeProvider.getBestNode();
|
||||||
Log.v(TAG,"connect.url: "+ mSelectedNode.getUrl()+", latency: "+mSelectedNode.getLatencyValue());
|
Log.v(TAG,"connect.url: "+ mSelectedNode.getUrl()+", latency: "+mSelectedNode.getLatencyValue());
|
||||||
|
|
Loading…
Reference in a new issue