I'm trying to properly configure the timeouts for my connections using HttpURLConnection.
My problem is that after the getResponseCode() call It always timeouts after 60 seconds instead of the value I set. My code:
URL url = new URL(uri.toString()); HttpURLConnection connection = (HttpURLConnection)url.openConnection(); connection.setConnectTimeout(Utils.DEFAULT_CONNECT_TIMEOUT_MILLIS15000); connection.setReadTimeout(Utils.DEFAULT_READ_TIMEOUT_MILLIS15000); int responseCode = connection.getResponseCode(); What do I am missing?