use of org.apache.http.conn.OperatedClientConnection in project platform_external_apache-http by android.
the class AbstractClientConnAdapter method getLocalPort.
// non-javadoc, see interface HttpInetConnection
public int getLocalPort() {
OperatedClientConnection conn = getWrappedConnection();
assertValid(conn);
return conn.getLocalPort();
}
use of org.apache.http.conn.OperatedClientConnection in project jmeter by apache.
the class ManagedClientConnectionImpl method open.
@Override
public void open(final HttpRoute route, final HttpContext context, final HttpParams params) throws IOException {
Args.notNull(route, "Route");
Args.notNull(params, "HTTP parameters");
final OperatedClientConnection conn;
synchronized (this) {
if (this.poolEntry == null) {
throw new ConnectionShutdownException();
}
final RouteTracker tracker = this.poolEntry.getTracker();
Asserts.notNull(tracker, "Route tracker");
Asserts.check(!tracker.isConnected(), "Connection already open");
conn = this.poolEntry.getConnection();
}
final HttpHost proxy = route.getProxyHost();
this.operator.openConnection(conn, (proxy != null) ? proxy : route.getTargetHost(), route.getLocalAddress(), context, params);
synchronized (this) {
if (this.poolEntry == null) {
throw new InterruptedIOException();
}
final RouteTracker tracker = this.poolEntry.getTracker();
if (proxy == null) {
tracker.connectTarget(conn.isSecure());
} else {
tracker.connectProxy(proxy, conn.isSecure());
}
}
}
use of org.apache.http.conn.OperatedClientConnection in project jmeter by apache.
the class ManagedClientConnectionImpl method tunnelTarget.
@Override
public void tunnelTarget(final boolean secure, final HttpParams params) throws IOException {
Args.notNull(params, "HTTP parameters");
final HttpHost target;
final OperatedClientConnection conn;
synchronized (this) {
if (this.poolEntry == null) {
throw new ConnectionShutdownException();
}
final RouteTracker tracker = this.poolEntry.getTracker();
Asserts.notNull(tracker, "Route tracker");
Asserts.check(tracker.isConnected(), "Connection not open");
Asserts.check(!tracker.isTunnelled(), "Connection is already tunnelled");
target = tracker.getTargetHost();
conn = this.poolEntry.getConnection();
}
conn.update(null, target, secure, params);
synchronized (this) {
if (this.poolEntry == null) {
throw new InterruptedIOException();
}
final RouteTracker tracker = this.poolEntry.getTracker();
tracker.tunnelTarget(secure);
}
}
use of org.apache.http.conn.OperatedClientConnection in project jmeter by apache.
the class ManagedClientConnectionImpl method receiveResponseEntity.
@Override
public void receiveResponseEntity(final HttpResponse response) throws HttpException, IOException {
final OperatedClientConnection conn = ensureConnection();
conn.receiveResponseEntity(response);
}
use of org.apache.http.conn.OperatedClientConnection in project jmeter by apache.
the class ManagedClientConnectionImpl method close.
@Override
public void close() throws IOException {
final HttpPoolEntry local = this.poolEntry;
if (local != null) {
final OperatedClientConnection conn = local.getConnection();
local.getTracker().reset();
conn.close();
}
}
Aggregations