|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.http.impl.AbstractHttpClientConnection org.apache.http.impl.SocketHttpClientConnection
DefaultBHttpClientConnection
@Deprecated public class SocketHttpClientConnection
Implementation of a client-side HTTP connection that can be bound to an
arbitrary Socket
for receiving data from and transmitting data to
a remote server.
Constructor Summary | |
---|---|
SocketHttpClientConnection()
Deprecated. |
Method Summary | |
---|---|
protected void |
assertNotOpen()
Deprecated. |
protected void |
assertOpen()
Deprecated. Asserts if the connection is open. |
protected void |
bind(Socket socket,
HttpParams params)
Deprecated. Binds this connection to the given Socket . |
void |
close()
Deprecated. Closes this connection gracefully. |
protected SessionInputBuffer |
createSessionInputBuffer(Socket socket,
int bufferSize,
HttpParams params)
Deprecated. Creates an instance of SocketInputBuffer to be used for
receiving data from the given Socket . |
protected SessionOutputBuffer |
createSessionOutputBuffer(Socket socket,
int bufferSize,
HttpParams params)
Deprecated. Creates an instance of SessionOutputBuffer to be used for
sending data to the given Socket . |
InetAddress |
getLocalAddress()
Deprecated. |
int |
getLocalPort()
Deprecated. |
InetAddress |
getRemoteAddress()
Deprecated. |
int |
getRemotePort()
Deprecated. |
protected Socket |
getSocket()
Deprecated. |
int |
getSocketTimeout()
Deprecated. Returns the socket timeout value. |
boolean |
isOpen()
Deprecated. Checks if this connection is open. |
void |
setSocketTimeout(int timeout)
Deprecated. Sets the socket timeout value. |
void |
shutdown()
Deprecated. Force-closes this connection. |
String |
toString()
Deprecated. |
Methods inherited from class org.apache.http.impl.AbstractHttpClientConnection |
---|
createConnectionMetrics, 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 SocketHttpClientConnection()
Method Detail |
---|
protected void assertNotOpen()
protected void assertOpen()
AbstractHttpClientConnection
assertOpen
in class AbstractHttpClientConnection
protected SessionInputBuffer createSessionInputBuffer(Socket socket, int bufferSize, HttpParams params) throws IOException
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.SocketInputBuffer.SocketInputBuffer(Socket, int, HttpParams)
protected SessionOutputBuffer createSessionOutputBuffer(Socket socket, int bufferSize, HttpParams params) throws IOException
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.SocketOutputBuffer.SocketOutputBuffer(Socket, int, HttpParams)
protected 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 createSessionInputBuffer(Socket, int, HttpParams)
and 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 isOpen()
will return true
.
socket
- the socket.params
- HTTP parameters.
IOException
- in case of an I/O error.public boolean isOpen()
HttpConnection
isOpen
in interface HttpConnection
protected Socket getSocket()
public InetAddress getLocalAddress()
getLocalAddress
in interface HttpInetConnection
public int getLocalPort()
getLocalPort
in interface HttpInetConnection
public InetAddress getRemoteAddress()
getRemoteAddress
in interface HttpInetConnection
public int getRemotePort()
getRemotePort
in interface HttpInetConnection
public void setSocketTimeout(int timeout)
HttpConnection
setSocketTimeout
in interface HttpConnection
timeout
- timeout value in millisecondspublic int getSocketTimeout()
HttpConnection
getSocketTimeout
in interface HttpConnection
0
if timeout is disabled or -1
if
timeout is undefined.public void shutdown() throws IOException
HttpConnection
shutdown
in interface HttpConnection
IOException
public void close() throws IOException
HttpConnection
shutdown
instead.
close
in interface Closeable
close
in interface HttpConnection
IOException
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |