Example usage for com.amazonaws ClientConfiguration setUseTcpKeepAlive

List of usage examples for com.amazonaws ClientConfiguration setUseTcpKeepAlive

Introduction

In this page you can find the example usage for com.amazonaws ClientConfiguration setUseTcpKeepAlive.

Prototype

public void setUseTcpKeepAlive(final boolean use) 

Source Link

Document

Sets whether or not to enable TCP KeepAlive support at the socket level.

Usage

From source file:com.amazon.kinesis.streaming.agent.AgentContext.java

License:Open Source License

public ClientConfiguration getAwsClientConfiguration() {
    ClientConfiguration config = new ClientConfiguration();
    config.setUserAgent(userAgent(config));
    config.setMaxConnections(maxConnections());
    config.setConnectionTimeout(connectionTimeoutMillis());
    config.setSocketTimeout(socketTimeoutMillis());
    config.setUseTcpKeepAlive(useTcpKeepAlive());
    config.setConnectionTTL(connectionTTLMillis());
    config.setUseGzip(useHttpGzip());//  w w w. j a v a2 s  .com
    return config;
}

From source file:com.smoketurner.pipeline.application.config.AwsConfiguration.java

License:Apache License

@JsonIgnore
public ClientConfiguration getClientConfiguration() {
    final ClientConfiguration clientConfig = new ClientConfiguration();
    if (proxy.isPresent()) {
        clientConfig.setProxyHost(proxy.get().getHostText());
        clientConfig.setProxyPort(proxy.get().getPort());
    }/*from  www  .  j av  a2 s  . c  om*/
    clientConfig.setUseTcpKeepAlive(true);
    // needs to be false to support streaming gunzipping
    clientConfig.setUseGzip(false);
    return clientConfig;
}