Package org.apache.http.impl

Examples of org.apache.http.impl.NoConnectionReuseStrategy


    protected void setStrategiesForClient(HttpClientBuilder httpClientBuilder, UrsusHttpClientConfiguration configuration) {
        final long keepAlive = configuration.getKeepAlive();

        // don't keep alive the HTTP connection and thus don't reuse the TCP socket
        if (keepAlive == 0) {
            httpClientBuilder.setConnectionReuseStrategy(new NoConnectionReuseStrategy());
        } else {
            httpClientBuilder.setConnectionReuseStrategy(new DefaultConnectionReuseStrategy());
            // either keep alive based on response header Keep-Alive,
            // or if the server can keep a persistent connection (-1), then override based on client's configuration
            httpClientBuilder.setKeepAliveStrategy(new DefaultConnectionKeepAliveStrategy() {
View Full Code Here

TOP

Related Classes of org.apache.http.impl.NoConnectionReuseStrategy

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.