Example usage for org.apache.http.impl HttpConnectionMetricsImpl HttpConnectionMetricsImpl

List of usage examples for org.apache.http.impl HttpConnectionMetricsImpl HttpConnectionMetricsImpl

Introduction

In this page you can find the example usage for org.apache.http.impl HttpConnectionMetricsImpl HttpConnectionMetricsImpl.

Prototype

public HttpConnectionMetricsImpl(HttpTransportMetrics httpTransportMetrics,
            HttpTransportMetrics httpTransportMetrics2) 

Source Link

Usage

From source file:net.oneandone.sushi.fs.webdav.WebdavConnection.java

public WebdavConnection(Socket socket, SessionInputBuffer input, SessionOutputBuffer output,
        HttpParams params) {//from  w  ww  .ja v a 2s . com
    this.socket = socket;
    this.entityserializer = new EntitySerializer(new StrictContentLengthStrategy());
    this.entitydeserializer = new EntityDeserializer(new LaxContentLengthStrategy());
    this.input = input;
    this.output = output;
    this.responseParser = new DefaultHttpResponseParser(input, null, new DefaultHttpResponseFactory(), params);
    this.requestWriter = new HttpRequestWriter(output, null, params);
    this.metrics = new HttpConnectionMetricsImpl(input.getMetrics(), output.getMetrics());
    this.open = true;
}

From source file:org.mycard.net.network.AndroidHttpClientConnection.java

/***
 * Bind socket and set HttpParams to AndroidHttpClientConnection
 * @param socket outgoing socket/*from   w  ww.  ja v  a2 s. c  o  m*/
 * @param params HttpParams
 * @throws IOException
  */
public void bind(final Socket socket, final HttpParams params) throws IOException {
    if (socket == null) {
        throw new IllegalArgumentException("Socket may not be null");
    }
    if (params == null) {
        throw new IllegalArgumentException("HTTP parameters may not be null");
    }
    assertNotOpen();
    socket.setTcpNoDelay(HttpConnectionParams.getTcpNoDelay(params));
    socket.setSoTimeout(HttpConnectionParams.getSoTimeout(params));

    int linger = HttpConnectionParams.getLinger(params);
    if (linger >= 0) {
        socket.setSoLinger(linger > 0, linger);
    }
    this.socket = socket;

    int buffersize = HttpConnectionParams.getSocketBufferSize(params);
    this.inbuffer = new SocketInputBuffer(socket, buffersize, params);
    this.outbuffer = new SocketOutputBuffer(socket, buffersize, params);

    maxHeaderCount = params.getIntParameter(CoreConnectionPNames.MAX_HEADER_COUNT, -1);
    maxLineLength = params.getIntParameter(CoreConnectionPNames.MAX_LINE_LENGTH, -1);

    this.requestWriter = new HttpRequestWriter(outbuffer, null, params);

    this.metrics = new HttpConnectionMetricsImpl(inbuffer.getMetrics(), outbuffer.getMetrics());

    this.open = true;
}