[url]http://blog.youkuaiyun.com/quansheng2580/article/details/6484246[/url]
// 创建一个Http连接
HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();
urlConn.setConnectTimeout(3000);
urlConn.setReadTimeout(3000);