DefaultBHttpClientConnection@NotThreadSafe @Deprecated public class SocketHttpClientConnection extends AbstractHttpClientConnection implements HttpInetConnection
Socket for receiving data from and transmitting data to
a remote server.| 构造器和说明 |
|---|
SocketHttpClientConnection()
已过时。
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
assertNotOpen()
已过时。
|
protected void |
assertOpen()
已过时。
Asserts if the connection is open.
|
protected void |
bind(java.net.Socket socket,
HttpParams params)
已过时。
Binds this connection to the given
Socket. |
void |
close()
已过时。
Closes this connection gracefully.
|
protected SessionInputBuffer |
createSessionInputBuffer(java.net.Socket socket,
int buffersize,
HttpParams params)
已过时。
Creates an instance of
SocketInputBuffer to be used for
receiving data from the given Socket. |
protected SessionOutputBuffer |
createSessionOutputBuffer(java.net.Socket socket,
int buffersize,
HttpParams params)
已过时。
Creates an instance of
SessionOutputBuffer to be used for
sending data to the given Socket. |
java.net.InetAddress |
getLocalAddress()
已过时。
|
int |
getLocalPort()
已过时。
|
java.net.InetAddress |
getRemoteAddress()
已过时。
|
int |
getRemotePort()
已过时。
|
protected java.net.Socket |
getSocket()
已过时。
|
int |
getSocketTimeout()
已过时。
Returns the socket timeout value.
|
boolean |
isOpen()
已过时。
Checks if this connection is open.
|
void |
setSocketTimeout(int timeout)
已过时。
Sets the socket timeout value.
|
void |
shutdown()
已过时。
Force-closes this connection.
|
java.lang.String |
toString()
已过时。
|
createConnectionMetrics, createEntityDeserializer, createEntitySerializer, createHttpResponseFactory, createRequestWriter, createResponseParser, doFlush, flush, getMetrics, init, isEof, isResponseAvailable, isStale, receiveResponseEntity, receiveResponseHeader, sendRequestEntity, sendRequestHeaderclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetMetrics, isStaleprotected void assertNotOpen()
protected void assertOpen()
AbstractHttpClientConnectionassertOpen 在类中 AbstractHttpClientConnectionprotected SessionInputBuffer createSessionInputBuffer(java.net.Socket socket, int buffersize, HttpParams params) throws java.io.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.java.io.IOException - in case of an I/O error.SocketInputBuffer.SocketInputBuffer(Socket, int, HttpParams)protected SessionOutputBuffer createSessionOutputBuffer(java.net.Socket socket, int buffersize, HttpParams params) throws java.io.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.java.io.IOException - in case of an I/O error.SocketOutputBuffer.SocketOutputBuffer(Socket, int, HttpParams)protected void bind(java.net.Socket socket,
HttpParams params)
throws java.io.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.java.io.IOException - in case of an I/O error.public boolean isOpen()
HttpConnectionisOpen 在接口中 HttpConnectionprotected java.net.Socket getSocket()
public java.net.InetAddress getLocalAddress()
getLocalAddress 在接口中 HttpInetConnectionpublic int getLocalPort()
getLocalPort 在接口中 HttpInetConnectionpublic java.net.InetAddress getRemoteAddress()
getRemoteAddress 在接口中 HttpInetConnectionpublic int getRemotePort()
getRemotePort 在接口中 HttpInetConnectionpublic void setSocketTimeout(int timeout)
HttpConnectionsetSocketTimeout 在接口中 HttpConnectiontimeout - timeout value in millisecondspublic int getSocketTimeout()
HttpConnectiongetSocketTimeout 在接口中 HttpConnection0 if timeout is disabled or -1 if
timeout is undefined.public void shutdown()
throws java.io.IOException
HttpConnectionshutdown 在接口中 HttpConnectionjava.io.IOExceptionpublic void close()
throws java.io.IOException
HttpConnectionshutdown instead.close 在接口中 HttpConnectionclose 在接口中 java.io.Closeableclose 在接口中 java.lang.AutoCloseablejava.io.IOExceptionpublic java.lang.String toString()
toString 在类中 java.lang.Object