public class AndroidHttpClientConnection extends Object
Constructor and Description |
---|
AndroidHttpClientConnection() |
Modifier and Type | Method and Description |
---|---|
void |
bind(Socket socket,
HttpParams params)
Bind socket and set HttpParams to AndroidHttpClientConnection
|
void |
close() |
protected void |
doFlush() |
void |
flush() |
InetAddress |
getLocalAddress() |
int |
getLocalPort() |
HttpConnectionMetrics |
getMetrics()
Returns a collection of connection metrcis
|
InetAddress |
getRemoteAddress() |
int |
getRemotePort() |
int |
getSocketTimeout() |
boolean |
isOpen() |
boolean |
isStale()
Checks whether this connection has gone down.
|
StatusLine |
parseResponseHeader(Headers headers)
Parses the response headers and adds them to the
given
headers object, and returns the response StatusLine |
HttpEntity |
receiveResponseEntity(Headers headers)
Return the next response entity.
|
void |
sendRequestEntity(HttpEntityEnclosingRequest request)
Sends the request entity over the connection.
|
void |
sendRequestHeader(HttpRequest request)
Sends the request line and all headers over the connection.
|
void |
setSocketTimeout(int timeout) |
void |
shutdown() |
String |
toString()
Returns a string containing a concise, human-readable description of this
object.
|
public void bind(Socket socket, HttpParams params) throws IOException
socket
- outgoing socketparams
- HttpParamsIOException
public String toString()
Object
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.
public boolean isOpen()
public InetAddress getLocalAddress()
public int getLocalPort()
public InetAddress getRemoteAddress()
public int getRemotePort()
public void setSocketTimeout(int timeout)
public int getSocketTimeout()
public void shutdown() throws IOException
IOException
public void close() throws IOException
IOException
public void sendRequestHeader(HttpRequest request) throws HttpException, IOException
request
- the request whose headers to send.HttpException
IOException
public void sendRequestEntity(HttpEntityEnclosingRequest request) throws HttpException, IOException
request
- the request whose entity to send.HttpException
IOException
protected void doFlush() throws IOException
IOException
public void flush() throws IOException
IOException
public StatusLine parseResponseHeader(Headers headers) throws IOException, ParseException
headers
object, and returns the response StatusLineheaders
- store parsed header to headers.IOException
ParseException
HttpClientConnection#receiveResponseHeader()
public HttpEntity receiveResponseEntity(Headers headers)
headers
- contains values for parsing entityHttpClientConnection#receiveResponseEntity(HttpResponse response)
public boolean isStale()
true
if attempts to use this connection are
likely to succeed, or false
if they are likely
to fail and this connection should be closedpublic HttpConnectionMetrics getMetrics()