|
|||||||||
| Home >> All >> org >> apache >> http >> [ params overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.http.params
Class HttpConnectionParams

java.lang.Objectorg.apache.http.params.HttpConnectionParams
- public final class HttpConnectionParams
- extends java.lang.Object
This class implements an adaptor around the HttpParams interface to simplify manipulation of the HTTP connection specific parameters.
- Since:
- 3.0
- Version:
- $Revision: 411109 $
| Field Summary | |
static java.lang.String |
CONNECTION_TIMEOUT
Determines the timeout until a connection is etablished. |
static java.lang.String |
MAX_HEADER_COUNT
Determines the maximum HTTP header count allowed. |
static java.lang.String |
MAX_LINE_LENGTH
Determines the maximum line length limit. |
static java.lang.String |
SO_LINGER
Sets SO_LINGER with the specified linger time in seconds. |
static java.lang.String |
SO_TIMEOUT
Defines the default socket timeout (SO_TIMEOUT) in milliseconds which is the timeout for waiting for data. |
static java.lang.String |
SOCKET_BUFFER_SIZE
Determines the size of the internal socket buffer used to buffer data while receiving / transmitting HTTP messages. |
static java.lang.String |
STALE_CONNECTION_CHECK
Determines whether stale connection check is to be used. |
static java.lang.String |
TCP_NODELAY
Determines whether Nagle's algorithm is to be used. |
| Constructor Summary | |
private |
HttpConnectionParams()
|
| Method Summary | |
static int |
getConnectionTimeout(HttpParams params)
Returns the timeout until a connection is etablished. |
static int |
getLinger(HttpParams params)
Returns linger-on-close timeout. |
static int |
getSocketBufferSize(HttpParams params)
|
static int |
getSoTimeout(HttpParams params)
Returns the default socket timeout (SO_TIMEOUT) in milliseconds which is the timeout for waiting for data. |
static boolean |
getTcpNoDelay(HttpParams params)
Tests if Nagle's algorithm is to be used. |
static boolean |
isStaleCheckingEnabled(HttpParams params)
Tests whether stale connection check is to be used. |
static void |
setConnectionTimeout(HttpParams params,
int timeout)
Sets the timeout until a connection is etablished. |
static void |
setLinger(HttpParams params,
int value)
Returns linger-on-close timeout. |
static void |
setSocketBufferSize(HttpParams params,
int size)
|
static void |
setSoTimeout(HttpParams params,
int timeout)
Sets the default socket timeout (SO_TIMEOUT) in milliseconds which is the timeout for waiting for data. |
static void |
setStaleCheckingEnabled(HttpParams params,
boolean value)
Defines whether stale connection check is to be used. |
static void |
setTcpNoDelay(HttpParams params,
boolean value)
Determines whether Nagle's algorithm is to be used. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
SO_TIMEOUT
public static final java.lang.String SO_TIMEOUT
- Defines 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.
This parameter expects a value of type java.lang.Integer.
TCP_NODELAY
public static final java.lang.String TCP_NODELAY
- 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.
This parameter expects a value of type java.lang.Boolean.
SOCKET_BUFFER_SIZE
public static final java.lang.String SOCKET_BUFFER_SIZE
- Determines the size of the internal socket buffer used to buffer data
while receiving / transmitting HTTP messages.
This parameter expects a value of type java.lang.Integer.
- See Also:
- Constant Field Values
SO_LINGER
public static final java.lang.String SO_LINGER
- Sets SO_LINGER with the specified linger time in seconds. The maximum timeout
value is platform specific. Value 0 implies that the option is disabled.
Value -1 implies that the JRE default is used. The setting only affects
socket close.
This parameter expects a value of type java.lang.Integer.
CONNECTION_TIMEOUT
public static final java.lang.String CONNECTION_TIMEOUT
- Determines the timeout until a connection is etablished. A value of zero
means the timeout is not used. The default value is zero.
This parameter expects a value of type java.lang.Integer.
- See Also:
- Constant Field Values
STALE_CONNECTION_CHECK
public static final java.lang.String STALE_CONNECTION_CHECK
- Determines 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.
This parameter expects a value of type java.lang.Boolean.
- See Also:
- Constant Field Values
MAX_LINE_LENGTH
public static final java.lang.String MAX_LINE_LENGTH
- Determines the maximum line length limit. If set to a positive value, any HTTP
line exceeding this limit will cause an IOException. A negative or zero value
will effectively disable the check.
This parameter expects a value of type java.lang.Integer.
- See Also:
- Constant Field Values
MAX_HEADER_COUNT
public static final java.lang.String MAX_HEADER_COUNT
- Determines the maximum HTTP header count allowed. If set to a positive value,
the number of HTTP headers received from the data stream exceeding this limit
will cause an IOException. A negative or zero value will effectively disable
the check.
This parameter expects a value of type java.lang.Integer.
- See Also:
- Constant Field Values
| Constructor Detail |
HttpConnectionParams
private HttpConnectionParams()
| Method Detail |
getSoTimeout
public static int getSoTimeout(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.
setSoTimeout
public static void setSoTimeout(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.
getTcpNoDelay
public static boolean getTcpNoDelay(HttpParams params)
- Tests if Nagle's algorithm is to be used.
setTcpNoDelay
public static void setTcpNoDelay(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.
getSocketBufferSize
public static int getSocketBufferSize(HttpParams params)
setSocketBufferSize
public static void setSocketBufferSize(HttpParams params, int size)
getLinger
public static int getLinger(HttpParams params)
- Returns linger-on-close timeout. Value 0 implies that the option is
disabled. Value -1 implies that the JRE default is used.
setLinger
public static void setLinger(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.
getConnectionTimeout
public static int getConnectionTimeout(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.
setConnectionTimeout
public static void setConnectionTimeout(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.
isStaleCheckingEnabled
public static boolean isStaleCheckingEnabled(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.
setStaleCheckingEnabled
public static void setStaleCheckingEnabled(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.
|
|||||||||
| Home >> All >> org >> apache >> http >> [ params overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.apache.http.params.HttpConnectionParams