httpclient 超时设置

DefaultHttpClient:
请求超时
httpclient.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 60000); 
读取超时
httpclient.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, 60000);

HttpClient
HttpClient httpClient=new HttpClient(); 
链接超时
httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(60000);  
读取超时
httpClient.getHttpConnectionManager().getParams().setSoTimeout(60000);

posted @ 2012-08-18 10:23  GreyWolf  阅读(149)  评论(0编辑  收藏  举报