Search in sources :

Example 56 with OperatedClientConnection

use of org.apache.http.conn.OperatedClientConnection in project jmeter by apache.

the class ManagedClientConnectionImpl method tunnelProxy.

@Override
public void tunnelProxy(final HttpHost next, final boolean secure, final HttpParams params) throws IOException {
    Args.notNull(next, "Next proxy");
    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 not open");
        conn = this.poolEntry.getConnection();
    }
    conn.update(null, next, secure, params);
    synchronized (this) {
        if (this.poolEntry == null) {
            throw new InterruptedIOException();
        }
        final RouteTracker tracker = this.poolEntry.getTracker();
        tracker.tunnelProxy(next, secure);
    }
}
Also used : InterruptedIOException(java.io.InterruptedIOException) ConnectionShutdownException(org.apache.http.impl.conn.ConnectionShutdownException) OperatedClientConnection(org.apache.http.conn.OperatedClientConnection) RouteTracker(org.apache.http.conn.routing.RouteTracker)

Example 57 with OperatedClientConnection

use of org.apache.http.conn.OperatedClientConnection in project jmeter by apache.

the class ManagedClientConnectionImpl method setSocketTimeout.

@Override
public void setSocketTimeout(final int timeout) {
    final OperatedClientConnection conn = ensureConnection();
    conn.setSocketTimeout(timeout);
}
Also used : OperatedClientConnection(org.apache.http.conn.OperatedClientConnection)

Example 58 with OperatedClientConnection

use of org.apache.http.conn.OperatedClientConnection in project jmeter by apache.

the class ManagedClientConnectionImpl method getSSLSession.

@Override
public SSLSession getSSLSession() {
    final OperatedClientConnection conn = ensureConnection();
    SSLSession result = null;
    final Socket sock = conn.getSocket();
    if (sock instanceof SSLSocket) {
        result = ((SSLSocket) sock).getSession();
    }
    return result;
}
Also used : SSLSocket(javax.net.ssl.SSLSocket) OperatedClientConnection(org.apache.http.conn.OperatedClientConnection) SSLSession(javax.net.ssl.SSLSession) Socket(java.net.Socket) SSLSocket(javax.net.ssl.SSLSocket)

Example 59 with OperatedClientConnection

use of org.apache.http.conn.OperatedClientConnection in project jmeter by apache.

the class ManagedClientConnectionImpl method sendRequestEntity.

@Override
public void sendRequestEntity(final HttpEntityEnclosingRequest request) throws HttpException, IOException {
    final OperatedClientConnection conn = ensureConnection();
    conn.sendRequestEntity(request);
}
Also used : OperatedClientConnection(org.apache.http.conn.OperatedClientConnection)

Example 60 with OperatedClientConnection

use of org.apache.http.conn.OperatedClientConnection in project jmeter by apache.

the class ManagedClientConnectionImpl method layerProtocol.

@Override
public void layerProtocol(final HttpContext context, 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(), "Protocol layering without a tunnel not supported");
        Asserts.check(!tracker.isLayered(), "Multiple protocol layering not supported");
        target = tracker.getTargetHost();
        conn = this.poolEntry.getConnection();
    }
    this.operator.updateSecureConnection(conn, target, context, params);
    synchronized (this) {
        if (this.poolEntry == null) {
            throw new InterruptedIOException();
        }
        final RouteTracker tracker = this.poolEntry.getTracker();
        tracker.layerProtocol(conn.isSecure());
    }
}
Also used : InterruptedIOException(java.io.InterruptedIOException) ConnectionShutdownException(org.apache.http.impl.conn.ConnectionShutdownException) HttpHost(org.apache.http.HttpHost) OperatedClientConnection(org.apache.http.conn.OperatedClientConnection) RouteTracker(org.apache.http.conn.routing.RouteTracker)

Aggregations

OperatedClientConnection (org.apache.http.conn.OperatedClientConnection)61 InterruptedIOException (java.io.InterruptedIOException)5 IOException (java.io.IOException)4 Socket (java.net.Socket)4 SSLSession (javax.net.ssl.SSLSession)4 SSLSocket (javax.net.ssl.SSLSocket)4 RouteTracker (org.apache.http.conn.routing.RouteTracker)4 ConnectionShutdownException (org.apache.http.impl.conn.ConnectionShutdownException)4 HttpHost (org.apache.http.HttpHost)3