Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1080503
  • 博文数量: 282
  • 博客积分: 10865
  • 博客等级: 上将
  • 技术积分: 2480
  • 用 户 组: 普通用户
  • 注册时间: 2006-05-12 12:35
文章存档

2017年(1)

2016年(3)

2015年(10)

2014年(12)

2013年(5)

2012年(10)

2011年(29)

2010年(3)

2008年(13)

2007年(92)

2006年(104)

我的朋友

分类: Java

2011-12-20 13:42:18

private HttpClient httpclient;
private HttpPost httppost;
private HttpParams httpParameters;
private int timeoutConnection = 3000;
private int timeoutSocket = 5000;
public WidsetsHttpClient() {
httpParameters = new BasicHttpParams();
// Set the timeout in milliseconds until a connection is established.
HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection);
// Set the default socket timeout (SO_TIMEOUT)
// in milliseconds which is the timeout for waiting for data.
HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);
httpclient = new DefaultHttpClient(httpParameters);
httppost = new HttpPost(Display.serviceAPI);
}

原文地址:
阅读(1028) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~