码迷,mamicode.com
首页 > 其他好文 > 详细

HttpClient超时设置

时间:2014-09-30 15:27:19      阅读:113      评论:0      收藏:0      [点我收藏+]

标签:style   http   color   io   ar   java   sp   c   on   

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);





HttpClient超时设置

标签:style   http   color   io   ar   java   sp   c   on   

原文地址:http://my.oschina.net/u/555639/blog/323450

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!