httpclient

private static MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
	private static HttpClient client = new HttpClient(connectionManager);


static {
		client.getHttpConnectionManager().getParams()
				.setConnectionTimeout(30000);
		client.getHttpConnectionManager().getParams().setSoTimeout(30000);
		client.getHttpConnectionManager().getParams()
				.setDefaultMaxConnectionsPerHost(8);
		client.getHttpConnectionManager().getParams()
				.setMaxTotalConnections(48);
		client.getHttpConnectionManager()
				.getParams()
				.setParameter(HttpMethodParams.RETRY_HANDLER,
						new DefaultHttpMethodRetryHandler());
		client.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET,
				"UTF-8");
	}

你可能感兴趣的:(httpclient)