日期:2014-05-18 浏览次数:20658 次
要看源码啊,老兄 /** * Sets the timeout until a connection is etablished. A value of zero * means the timeout is not used. The default value is zero. * * @see HttpConnection#setConnectionTimeout(int) * @param newTimeoutInMilliseconds Timeout in milliseconds. * * @deprecated Use * {@link org.apache.commons.httpclient.params.HttpConnectionManagerParams#setConnectionTimeout(int)}, * {@link HttpConnectionManager#getParams()}. */ public synchronized void setConnectionTimeout(int newTimeoutInMilliseconds) { this.httpConnectionManager.getParams().setConnectionTimeout(newTimeoutInMilliseconds); } /** * Sets the socket timeout (<tt>SO_TIMEOUT</tt>) in milliseconds which is the * timeout for waiting for data. A timeout value of zero is interpreted as an * infinite timeout. * * @param newTimeoutInMilliseconds Timeout in milliseconds * * @deprecated Use * {@link org.apache.commons.httpclient.params.HttpConnectionManagerParams#setSoTimeout(int)}, * {@link HttpConnectionManager#getParams()}. * */ public synchronized void setTimeout(int newTimeoutInMilliseconds) { this.params.setSoTimeout(newTimeoutInMilliseconds); }
------解决方案--------------------
没注意时间顶起了这么老的帖子 晕