Methods Summary |
---|
public void | close()
log.debug("Connection closed");
super.close();
|
protected org.apache.http.io.HttpMessageParser | createResponseParser(org.apache.http.io.SessionInputBuffer buffer, org.apache.http.HttpResponseFactory responseFactory, org.apache.http.params.HttpParams params)
// override in derived class to specify a line parser
return new DefaultResponseParser
(buffer, null, responseFactory, params);
|
protected org.apache.http.io.SessionInputBuffer | createSessionInputBuffer(java.net.Socket socket, int buffersize, org.apache.http.params.HttpParams params)
SessionInputBuffer inbuffer = super.createSessionInputBuffer(
socket,
buffersize,
params);
if (wireLog.isDebugEnabled()) {
inbuffer = new LoggingSessionInputBuffer(inbuffer, new Wire(wireLog));
}
return inbuffer;
|
protected org.apache.http.io.SessionOutputBuffer | createSessionOutputBuffer(java.net.Socket socket, int buffersize, org.apache.http.params.HttpParams params)
SessionOutputBuffer outbuffer = super.createSessionOutputBuffer(
socket,
buffersize,
params);
if (wireLog.isDebugEnabled()) {
outbuffer = new LoggingSessionOutputBuffer(outbuffer, new Wire(wireLog));
}
return outbuffer;
|
public final java.net.Socket | getSocket()
return this.socket;
|
public final org.apache.http.HttpHost | getTargetHost()
return this.targetHost;
|
public final boolean | isSecure()
return this.connSecure;
|
public void | openCompleted(boolean secure, org.apache.http.params.HttpParams params)
assertNotOpen();
if (params == null) {
throw new IllegalArgumentException
("Parameters must not be null.");
}
this.connSecure = secure;
bind(this.socket, params);
|
public void | opening(java.net.Socket sock, org.apache.http.HttpHost target)
assertNotOpen();
this.socket = sock;
this.targetHost = target;
// Check for shutdown after assigning socket, so that
if (this.shutdown) {
sock.close(); // allow this to throw...
// ...but if it doesn't, explicitly throw one ourselves.
throw new IOException("Connection already shutdown");
}
|
public org.apache.http.HttpResponse | receiveResponseHeader()
HttpResponse response = super.receiveResponseHeader();
if (headerLog.isDebugEnabled()) {
headerLog.debug("<< " + response.getStatusLine().toString());
Header[] headers = response.getAllHeaders();
for (Header header : headers) {
headerLog.debug("<< " + header.toString());
}
}
return response;
|
public void | sendRequestHeader(org.apache.http.HttpRequest request)
super.sendRequestHeader(request);
if (headerLog.isDebugEnabled()) {
headerLog.debug(">> " + request.getRequestLine().toString());
Header[] headers = request.getAllHeaders();
for (Header header : headers) {
headerLog.debug(">> " + header.toString());
}
}
|
public void | shutdown()Force-closes this connection.
If the connection is still in the process of being open (the method
{@link #opening opening} was already called but
{@link #openCompleted openCompleted} was not), the associated
socket that is being connected to a remote address will be closed.
That will interrupt a thread that is blocked on connecting
the socket.
If the connection is not yet open, this will prevent the connection
from being opened.
log.debug("Connection shut down");
shutdown = true;
super.shutdown();
Socket sock = this.socket; // copy volatile attribute
if (sock != null)
sock.close();
|
public void | update(java.net.Socket sock, org.apache.http.HttpHost target, boolean secure, org.apache.http.params.HttpParams params)
assertOpen();
if (target == null) {
throw new IllegalArgumentException
("Target host must not be null.");
}
if (params == null) {
throw new IllegalArgumentException
("Parameters must not be null.");
}
if (sock != null) {
this.socket = sock;
bind(sock, params);
}
targetHost = target;
connSecure = secure;
|