Exemple #1
0
 /**
  * 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);
 }
Exemple #2
0
 /**
  * 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);
 }