Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

Commit

Permalink
Set default connection timeout to match with iOS counterpart
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-gladeye committed Feb 24, 2016
1 parent 0e5b29d commit 6e924ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public static void download(String urlFrom, String filePath, String checkSum) th
}

URLConnection connection = downloadUrl.openConnection();
connection.setConnectTimeout(60000);
connection.connect();

InputStream input = new BufferedInputStream(downloadUrl.openStream());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ private String downloadJson() throws Exception {
}

URLConnection urlConnection = url.openConnection();
urlConnection.setConnectTimeout(60000);
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));

char data[] = new char[1024];
Expand Down

0 comments on commit 6e924ac

Please sign in to comment.