Example usage for org.apache.http.nio.conn ManagedClientAsyncConnection abortConnection

List of usage examples for org.apache.http.nio.conn ManagedClientAsyncConnection abortConnection

Introduction

In this page you can find the example usage for org.apache.http.nio.conn ManagedClientAsyncConnection abortConnection.

Prototype

void abortConnection() throws IOException;

Source Link

Document

Releases the connection without the option of keep-alive.

Usage

From source file:org.apache.http.impl.nio.client.DefaultAsyncRequestDirector.java

@Override
public void close() {
    if (this.closed) {
        return;// w  w  w  . j a  v  a  2 s . c  o m
    }
    this.closed = true;
    final ManagedClientAsyncConnection localConn = this.managedConn;
    if (localConn != null) {
        if (this.log.isDebugEnabled()) {
            this.log.debug("[exchange: " + this.id + "] aborting connection " + localConn);
        }
        try {
            localConn.abortConnection();
        } catch (final IOException ioex) {
            this.log.debug("I/O error releasing connection", ioex);
        }
    }
    try {
        this.requestProducer.close();
    } catch (final IOException ex) {
        this.log.debug("I/O error closing request producer", ex);
    }
    try {
        this.responseConsumer.close();
    } catch (final IOException ex) {
        this.log.debug("I/O error closing response consumer", ex);
    }
}