All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.imperva.shcf4j.config.SocketConfig Maven / Gradle / Ivy

Go to download

The Simple HTTP Client Facade for Java (SHCF4J) serves as a simple facade or abstraction for various HTTP client frameworks (e.g. java.net.HttpURLConnection, Apache HttpClient, etc.) allowing the end user to plug in the desired HTTP client framework at deployment time.

The newest version!
package com.imperva.shcf4j.config;

import lombok.Builder;
import lombok.Value;

/**
 * SocketConfig
 *
 *
 * @author maxim.kirilov
 */
@Builder
@Value
public final class SocketConfig {

    /**
     * Determines the default socket timeout value for non-blocking I/O operations.
     *
     * Default: 0 (no timeout)
     *
     * @see java.net.SocketOptions#SO_TIMEOUT
     */
    @Builder.Default
    private final int soTimeoutMilliseconds = 0;

    /**
     * Determines the default value of the {@link java.net.SocketOptions#SO_REUSEADDR} parameter
     * for newly created sockets.
     *
     * Default: false
     *
     * @see java.net.SocketOptions#SO_REUSEADDR
     */
    @Builder.Default
    private final boolean soReuseAddress = false;

    /**
     * Determines the default value of the {@link java.net.SocketOptions#SO_LINGER} parameter
     * for newly created sockets.
     *
     * Default: -1
     *
     * @see java.net.SocketOptions#SO_LINGER
     */
    @Builder.Default
    private int soLingerSeconds = -1;

    /**
     * Determines the default value of the {@link java.net.SocketOptions#SO_KEEPALIVE} parameter
     * for newly created sockets.
     *
     * Default: -1
     *
     * @see java.net.SocketOptions#SO_KEEPALIVE
     */
    private final boolean soKeepAlive;

    /**
     * Determines the default value of the {@link java.net.SocketOptions#TCP_NODELAY} parameter
     * for newly created sockets.
     *
     * Default: false
     *
     * @see java.net.SocketOptions#TCP_NODELAY
     */
    @Builder.Default
    private final boolean tcpNoDelay = false;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy