X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Futils%2FNetworkUtil.java;h=44a7eb9db579a539388aaf83ad38c7da708d5857;hb=053aca6d22a84b557945109f2c5d3c0120b4ac44;hp=8386bbff057b85fc2cfac0bb6e6d946985ca619d;hpb=6b740c280c79b0170321f533747cdbfc3e179a29;p=mobile-ledger.git diff --git a/app/src/main/java/net/ktnx/mobileledger/utils/NetworkUtil.java b/app/src/main/java/net/ktnx/mobileledger/utils/NetworkUtil.java index 8386bbff..44a7eb9d 100644 --- a/app/src/main/java/net/ktnx/mobileledger/utils/NetworkUtil.java +++ b/app/src/main/java/net/ktnx/mobileledger/utils/NetworkUtil.java @@ -26,6 +26,7 @@ import java.net.HttpURLConnection; import java.net.URL; public final class NetworkUtil { + private static final int thirtySeconds = 30000; public static HttpURLConnection prepare_connection(SharedPreferences pref, String path) throws IOException { final String backend_url = pref.getString("backend_url", ""); @@ -43,6 +44,8 @@ public final class NetworkUtil { http.setRequestProperty("Accept-Charset", "UTF-8"); http.setInstanceFollowRedirects(false); http.setUseCaches(false); + http.setReadTimeout(thirtySeconds); + http.setConnectTimeout(thirtySeconds); return http; }