Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }