我在源头上做了一些窥探,发现了这两种方法。所以看起来它们默认为0。
/**
* Obtains value of the {@link CoreConnectionPNames#CONNECTION_TIMEOUT}
* parameter. If not set, defaults to <code>0</code>.
*
* @param params HTTP parameters.
* @return connect timeout.
*/
public static int getConnectionTimeout(final HttpParams params) {
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
return params.getIntParameter
(CoreConnectionPNames.CONNECTION_TIMEOUT, 0);
}
/**
* Obtains value of the {@link CoreConnectionPNames#SO_TIMEOUT} parameter.
* If not set, defaults to <code>0</code>.
*
* @param params HTTP parameters.
* @return SO_TIMEOUT.
*/
public static int getSoTimeout(final HttpParams params) {
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
return params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0);
}