|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.params.HttpConnectionParams
public final class HttpConnectionParams
An adaptor for accessing connection parameters in HttpParams
.
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 |
MAX_STATUS_LINE_GARBAGE
Defines the maximum number of ignorable lines before we expect a HTTP response's status code. |
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. |
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 |
---|
public static final java.lang.String SO_TIMEOUT
This parameter expects a value of type Integer
.
SocketOptions.SO_TIMEOUT
,
Constant Field Valuespublic static final java.lang.String TCP_NODELAY
This parameter expects a value of type Boolean
.
SocketOptions.TCP_NODELAY
,
Constant Field Valuespublic static final java.lang.String SOCKET_BUFFER_SIZE
This parameter expects a value of type Integer
.
public static final java.lang.String SO_LINGER
This parameter expects a value of type Integer
.
SocketOptions.SO_LINGER
,
Constant Field Valuespublic static final java.lang.String CONNECTION_TIMEOUT
This parameter expects a value of type Integer
.
public static final java.lang.String STALE_CONNECTION_CHECK
This parameter expects a value of type Boolean
.
public static final java.lang.String MAX_LINE_LENGTH
This parameter expects a value of type Integer
.
public static final java.lang.String MAX_HEADER_COUNT
This parameter expects a value of type Integer
.
public static final java.lang.String MAX_STATUS_LINE_GARBAGE
With HTTP/1.1 persistent connections, the problem arises that
broken scripts could return a wrong Content-Length
(there are more bytes sent than specified).
Unfortunately, in some cases, this is not possible after the bad response,
but only before the next one.
So, HttpClient must be able to skip those surplus lines this way.
Set this to 0 to disallow any garbage/empty lines before the status line.
To specify no limit, use Integer.MAX_VALUE
(default in lenient mode).
Integer
.
Method Detail |
---|
public static int getSoTimeout(HttpParams params)
public static void setSoTimeout(HttpParams params, int timeout)
timeout
- Timeout in millisecondspublic static boolean getTcpNoDelay(HttpParams params)
public static void setTcpNoDelay(HttpParams params, boolean value)
value
- true if the Nagle's algorithm is to NOT be used
(that is enable TCP_NODELAY), false otherwise.public static int getSocketBufferSize(HttpParams params)
public static void setSocketBufferSize(HttpParams params, int size)
public static int getLinger(HttpParams params)
public static void setLinger(HttpParams params, int value)
value
- the linger-on-close timeoutpublic static int getConnectionTimeout(HttpParams params)
public static void setConnectionTimeout(HttpParams params, int timeout)
timeout
- Timeout in milliseconds.public static boolean isStaleCheckingEnabled(HttpParams params)
public static void setStaleCheckingEnabled(HttpParams params, boolean value)
value
- true if stale connection check is to be used,
false otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |