Package com.belladati.httpclientandroidlib.impl.conn

Examples of com.belladati.httpclientandroidlib.impl.conn.PoolingHttpClientConnectionManager


      // configure caching
      CacheConfig cacheConfig = CacheConfig.copy(CacheConfig.DEFAULT).setSharedCache(false).setMaxCacheEntries(1000)
        .setMaxObjectSize(2 * 1024 * 1024).build();

      // configure connection pooling
      PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager();
      int connectionLimit = readFromProperty("bdMaxConnections", 40);
      // there's only one server to connect to, so max per route matters
      connManager.setMaxTotal(connectionLimit);
      connManager.setDefaultMaxPerRoute(connectionLimit);

      // create the HTTP client
      return CachingHttpClientBuilder.create().setCacheConfig(cacheConfig).setSslcontext(sslContext)
        .setDefaultRequestConfig(requestConfig).setConnectionManager(connManager).build();
    } catch (GeneralSecurityException e) {
View Full Code Here


    private final HttpClient httpClient;
    private final ObjectMapper jsonMapper;
    private Session session;

    public Client() {
        PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager();
        connectionManager.setDefaultMaxPerRoute(2);

        RequestConfig requestConfig = RequestConfig.custom()
                .setConnectTimeout(TIMEOUT)
                .setSocketTimeout(TIMEOUT)
                .build();
View Full Code Here

TOP

Related Classes of com.belladati.httpclientandroidlib.impl.conn.PoolingHttpClientConnectionManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.