public final class

HttpConnectionParams

extends Object
implements CoreConnectionPNames
java.lang.Object
   ↳ org.apache.http.params.HttpConnectionParams

Class Overview

Utility class for accessing connection parameters in HttpParams.

Summary

[Expand]
Inherited Constants
From interface org.apache.http.params.CoreConnectionPNames
Public Methods
static int getConnectionTimeout(HttpParams params)
Obtains value of the CONNECTION_TIMEOUT parameter.
static int getLinger(HttpParams params)
Obtains value of the SO_LINGER parameter.
static boolean getSoReuseaddr(HttpParams params)
Obtains value of the SO_REUSEADDR parameter.
static int getSoTimeout(HttpParams params)
Obtains value of the SO_TIMEOUT parameter.
static int getSocketBufferSize(HttpParams params)
Obtains value of the SOCKET_BUFFER_SIZE parameter.
static boolean getTcpNoDelay(HttpParams params)
Obtains value of the TCP_NODELAY parameter.
static boolean isStaleCheckingEnabled(HttpParams params)
Obtains value of the STALE_CONNECTION_CHECK parameter.
static void setConnectionTimeout(HttpParams params, int timeout)
Sets value of the CONNECTION_TIMEOUT parameter.
static void setLinger(HttpParams params, int value)
Sets value of the SO_LINGER parameter.
static void setSoReuseaddr(HttpParams params, boolean reuseaddr)
Sets value of the SO_REUSEADDR parameter.
static void setSoTimeout(HttpParams params, int timeout)
Sets value of the SO_TIMEOUT parameter.
static void setSocketBufferSize(HttpParams params, int size)
Sets value of the SOCKET_BUFFER_SIZE parameter.
static void setStaleCheckingEnabled(HttpParams params, boolean value)
Sets value of the STALE_CONNECTION_CHECK parameter.
static void setTcpNoDelay(HttpParams params, boolean value)
Sets value of the TCP_NODELAY parameter.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static int getConnectionTimeout (HttpParams params)

Obtains value of the CONNECTION_TIMEOUT parameter. If not set, defaults to 0.

Parameters
params HTTP parameters.
Returns
  • connect timeout.

public static int getLinger (HttpParams params)

Obtains value of the SO_LINGER parameter. If not set, defaults to -1.

Parameters
params HTTP parameters.
Returns
  • SO_LINGER.

public static boolean getSoReuseaddr (HttpParams params)

Obtains value of the SO_REUSEADDR parameter. If not set, defaults to false.

Parameters
params HTTP parameters.
Returns
  • SO_REUSEADDR.

public static int getSoTimeout (HttpParams params)

Obtains value of the SO_TIMEOUT parameter. If not set, defaults to 0.

Parameters
params HTTP parameters.
Returns
  • SO_TIMEOUT.

public static int getSocketBufferSize (HttpParams params)

Obtains value of the SOCKET_BUFFER_SIZE parameter. If not set, defaults to -1.

Parameters
params HTTP parameters.
Returns
  • socket buffer size

public static boolean getTcpNoDelay (HttpParams params)

Obtains value of the TCP_NODELAY parameter. If not set, defaults to true.

Parameters
params HTTP parameters.
Returns
  • Nagle's algorithm flag

public static boolean isStaleCheckingEnabled (HttpParams params)

Obtains value of the STALE_CONNECTION_CHECK parameter. If not set, defaults to true.

Parameters
params HTTP parameters.
Returns
  • stale connection check flag.

public static void setConnectionTimeout (HttpParams params, int timeout)

Sets value of the CONNECTION_TIMEOUT parameter.

Parameters
params HTTP parameters.
timeout connect timeout.

public static void setLinger (HttpParams params, int value)

Sets value of the SO_LINGER parameter.

Parameters
params HTTP parameters.
value SO_LINGER.

public static void setSoReuseaddr (HttpParams params, boolean reuseaddr)

Sets value of the SO_REUSEADDR parameter.

Parameters
params HTTP parameters.
reuseaddr SO_REUSEADDR.

public static void setSoTimeout (HttpParams params, int timeout)

Sets value of the SO_TIMEOUT parameter.

Parameters
params HTTP parameters.
timeout SO_TIMEOUT.

public static void setSocketBufferSize (HttpParams params, int size)

Sets value of the SOCKET_BUFFER_SIZE parameter.

Parameters
params HTTP parameters.
size socket buffer size

public static void setStaleCheckingEnabled (HttpParams params, boolean value)

Sets value of the STALE_CONNECTION_CHECK parameter.

Parameters
params HTTP parameters.
value stale connection check flag.

public static void setTcpNoDelay (HttpParams params, boolean value)

Sets value of the TCP_NODELAY parameter.

Parameters
params HTTP parameters.
value Nagle's algorithm flag