/** * Sets the read timeout for the underlying {@link HttpURLConnection} * * @param duration duration of the timeout * * @param unit unit of time (milliseconds, seconds, etc) */ public void setReadTimeout(int duration, TimeUnit unit) { this.readTimeout = unit.toMillis(duration); }
/** * Sets the connect timeout for the underlying {@link HttpURLConnection} * * @param duration duration of the timeout * * @param unit unit of time (milliseconds, seconds, etc) */ public void setConnectTimeout(int duration, TimeUnit unit) { this.connectTimeout = unit.toMillis(duration); }