下面列出了怎么用org.apache.http.conn.ManagedClientConnection的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* Shuts down the connection.
* This method is called from a <code>catch</code> block in
* {@link #execute execute} during exception handling.
*/
private void abortConnection() {
ManagedClientConnection mcc = managedConn;
if (mcc != null) {
// we got here as the result of an exception
// no response will be returned, release the connection
managedConn = null;
try {
mcc.abortConnection();
} catch (IOException ex) {
if (DEBUG) {
Logger.debug(ex.getMessage(), ex);
}
}
// ensure the connection manager properly releases this connection
try {
mcc.releaseConnection();
} catch (IOException ignored) {
if (DEBUG) {
Logger.debug("Error releasing connection", ignored);
}
}
}
}