|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.impl.AbstractHttpClientConnection
org.apache.http.impl.SocketHttpClientConnection
org.apache.http.impl.DefaultHttpClientConnection
public class DefaultHttpClientConnection
Default implementation of a client-side HTTP connection.
Constructor Summary | |
---|---|
DefaultHttpClientConnection()
|
Method Summary | |
---|---|
void |
bind(Socket socket,
HttpParams params)
Binds this connection to the given Socket . |
String |
toString()
|
Methods inherited from class org.apache.http.impl.SocketHttpClientConnection |
---|
assertNotOpen, assertOpen, close, createSessionInputBuffer, createSessionOutputBuffer, getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort, getSocket, getSocketTimeout, isOpen, setSocketTimeout, shutdown |
Methods inherited from class org.apache.http.impl.AbstractHttpClientConnection |
---|
createEntityDeserializer, createEntitySerializer, createHttpResponseFactory, createRequestWriter, createResponseParser, doFlush, flush, getMetrics, init, isEof, isResponseAvailable, isStale, receiveResponseEntity, receiveResponseHeader, sendRequestEntity, sendRequestHeader |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.http.HttpConnection |
---|
getMetrics, isStale |
Constructor Detail |
---|
public DefaultHttpClientConnection()
Method Detail |
---|
public void bind(Socket socket, HttpParams params) throws IOException
Socket
. This socket will be
used by the connection to send and receive data.
This method will invoke SocketHttpClientConnection.createSessionInputBuffer(Socket, int, HttpParams)
and SocketHttpClientConnection.createSessionOutputBuffer(Socket, int, HttpParams)
methods
to create session input / output buffers bound to this socket and then
will invoke AbstractHttpClientConnection.init(SessionInputBuffer, SessionOutputBuffer, HttpParams)
method to pass references to those buffers to the underlying HTTP message
parser and formatter.
After this method's execution the connection status will be reported
as open and the SocketHttpClientConnection.isOpen()
will return true
.
The following HTTP parameters affect configuration of this connection:
The CoreConnectionPNames.SOCKET_BUFFER_SIZE
parameter determines the size of the internal socket buffer. If not
defined or set to -1
the default value will be chosen
automatically.
CoreConnectionPNames.TCP_NODELAY
parameter 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.
CoreConnectionPNames.SO_TIMEOUT
parameter defines the socket
timeout in milliseconds, which is the timeout for waiting for data.
A timeout value of zero is interpreted as an infinite timeout.
CoreConnectionPNames.SO_LINGER
parameter defines 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 to be used. The setting only affects
socket close.
bind
in class SocketHttpClientConnection
socket
- the socket.params
- HTTP parameters.
IOException
- in case of an I/O error.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |