Methods Summary |
---|
public static int | getConnectionTimeout(org.apache.http.params.HttpParams params)Returns the timeout until a connection is etablished. A value of zero
means the timeout is not used. The default value is zero.
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
return params.getIntParameter
(CoreConnectionPNames.CONNECTION_TIMEOUT, 0);
|
public static int | getLinger(org.apache.http.params.HttpParams params)Returns linger-on-close timeout. Value 0 implies that the option is
disabled. Value -1 implies that the JRE default is used.
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
return params.getIntParameter(CoreConnectionPNames.SO_LINGER, -1);
|
public static int | getSoTimeout(org.apache.http.params.HttpParams params)Returns the default socket timeout (SO_TIMEOUT) in milliseconds which is the
timeout for waiting for data. A timeout value of zero is interpreted as an infinite
timeout. This value is used when no socket timeout is set in the
method parameters.
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
return params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0);
|
public static int | getSocketBufferSize(org.apache.http.params.HttpParams params)
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
return params.getIntParameter
(CoreConnectionPNames.SOCKET_BUFFER_SIZE, -1);
|
public static boolean | getTcpNoDelay(org.apache.http.params.HttpParams params)Tests if Nagle's algorithm is to be used.
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
return params.getBooleanParameter
(CoreConnectionPNames.TCP_NODELAY, true);
|
public static boolean | isStaleCheckingEnabled(org.apache.http.params.HttpParams params)Tests whether stale connection check is to be used. Disabling
stale connection check may result in slight performance improvement
at the risk of getting an I/O error when executing a request over a
connection that has been closed at the server side.
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
return params.getBooleanParameter
(CoreConnectionPNames.STALE_CONNECTION_CHECK, true);
|
public static void | setConnectionTimeout(org.apache.http.params.HttpParams params, int timeout)Sets the timeout until a connection is etablished. A value of zero
means the timeout is not used. The default value is zero.
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
params.setIntParameter
(CoreConnectionPNames.CONNECTION_TIMEOUT, timeout);
|
public static void | setLinger(org.apache.http.params.HttpParams params, int value)Returns linger-on-close timeout. This option disables/enables immediate return
from a close() of a TCP Socket. Enabling this option with a non-zero Integer
timeout means that a close() will block pending the transmission and
acknowledgement of all data written to the peer, at which point the socket is
closed gracefully. Value 0 implies that the option is
disabled. Value -1 implies that the JRE default is used.
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
params.setIntParameter(CoreConnectionPNames.SO_LINGER, value);
|
public static void | setSoTimeout(org.apache.http.params.HttpParams params, int timeout)Sets the default socket timeout (SO_TIMEOUT) in milliseconds which is the
timeout for waiting for data. A timeout value of zero is interpreted as an infinite
timeout. This value is used when no socket timeout is set in the
method parameters.
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, timeout);
|
public static void | setSocketBufferSize(org.apache.http.params.HttpParams params, int size)
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
params.setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, size);
|
public static void | setStaleCheckingEnabled(org.apache.http.params.HttpParams params, boolean value)Defines whether stale connection check is to be used. Disabling
stale connection check may result in slight performance improvement
at the risk of getting an I/O error when executing a request over a
connection that has been closed at the server side.
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
params.setBooleanParameter
(CoreConnectionPNames.STALE_CONNECTION_CHECK, value);
|
public static void | setTcpNoDelay(org.apache.http.params.HttpParams params, boolean value)Determines whether Nagle's algorithm is to be used. The Nagle's algorithm
tries to conserve bandwidth by minimizing the number of segments that are
sent. When applications wish to decrease network latency and increase
performance, they can disable Nagle's algorithm (that is enable TCP_NODELAY).
Data will be sent earlier, at the cost of an increase in bandwidth consumption.
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
params.setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, value);
|