java.lang.Object | ||
↳ | org.apache.http.impl.AbstractHttpServerConnection | |
↳ | org.apache.http.impl.SocketHttpServerConnection |
Known Direct Subclasses |
Implementation of a server-side HTTP connection that can be bound to a network Socket in order to receive and transmit data.
The following parameters can be used to customize the behavior of this class:
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Closes this connection gracefully.
| |||||||||||
Returns the socket timeout value.
| |||||||||||
Checks if this connection is open.
| |||||||||||
Sets the socket timeout value.
| |||||||||||
Force-closes this connection.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Asserts if the connection is open.
| |||||||||||
Binds this connection to the given
Socket . | |||||||||||
This method is deprecated.
Use
createSessionInputBuffer(Socket, int, HttpParams)
| |||||||||||
This method is deprecated.
Use
createSessionOutputBuffer(Socket, int, HttpParams)
| |||||||||||
Creates an instance of
SocketInputBuffer to be used for
receiving data from the given Socket . | |||||||||||
Creates an instance of
SessionOutputBuffer to be used for
sending data to the given Socket . | |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.http.impl.AbstractHttpServerConnection
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.apache.http.HttpConnection
| |||||||||||
From interface
org.apache.http.HttpInetConnection
| |||||||||||
From interface
org.apache.http.HttpServerConnection
|
Closes this connection gracefully.
This method will attempt to flush the internal output
buffer prior to closing the underlying socket.
This method MUST NOT be called from a different thread to force
shutdown of the connection. Use shutdown
instead.
IOException |
---|
Returns the socket timeout value.
0
if timeout is disabled or -1
if
timeout is undefined.
Checks if this connection is open.
Sets the socket timeout value.
timeout | timeout value in milliseconds |
---|
Force-closes this connection. This is the only method of a connection which may be called from a different thread to terminate the connection. This method will not attempt to flush the transmitter's internal buffer prior to closing the underlying socket.
IOException |
---|
Asserts if the connection is open.
Binds this connection to the given Socket
. This socket will be
used by the connection to send and receive data.
This method will invoke createSessionInputBuffer(Socket, int, HttpParams)
and createSessionOutputBuffer(Socket, int, HttpParams)
methods
to create session input / output buffers bound to this socket and then
will invoke 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 isOpen()
will return true
.
socket | the socket. |
---|---|
params | HTTP parameters. |
IOException | in case of an I/O error. |
---|
This method is deprecated.
Use createSessionOutputBuffer(Socket, int, HttpParams)
IOException |
---|
Creates an instance of SocketInputBuffer
to be used for
receiving data from the given Socket
.
This method can be overridden in a super class in order to provide
a custom implementation of SessionInputBuffer
interface.
socket | the socket. |
---|---|
buffersize | the buffer size. |
params | HTTP parameters. |
IOException | in case of an I/O error. |
---|
Creates an instance of SessionOutputBuffer
to be used for
sending data to the given Socket
.
This method can be overridden in a super class in order to provide
a custom implementation of SocketOutputBuffer
interface.
socket | the socket. |
---|---|
buffersize | the buffer size. |
params | HTTP parameters. |
IOException | in case of an I/O error. |
---|