Apache JMeter

## org.apache.jmeter.protocol.http.util
Class LoopbackHttpClientSocketFactory

    java.lang.Object
      org.apache.jmeter.protocol.http.util.LoopbackHttpClientSocketFactory

All Implemented Interfaces:
  org.apache.commons.httpclient.protocol.ProtocolSocketFactory

    public class LoopbackHttpClientSocketFactory

extends Object
implements org.apache.commons.httpclient.protocol.ProtocolSocketFactory

HttpClient protocol factory to generate Loopback HTTP sockets

Constructor Summary
`LoopbackHttpClientSocketFactory()`

Method Summary
`Socket` `createSocket(String host, int port)`
`Socket` `createSocket(String host, int port, InetAddress clientHost, int clientPort)`
`Socket` `createSocket(String host, int port, InetAddress localAddress, int localPort, org.apache.commons.httpclient.params.HttpConnectionParams params)`
`static void` `setup()` Convenience method to set up the necessary HttpClient protocol and URL handler.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### LoopbackHttpClientSocketFactory

    public LoopbackHttpClientSocketFactory()

Method Detail

### createSocket

    public Socket createSocket(String host,
                               int port,
                               InetAddress clientHost,
                               int clientPort)
                        throws IOException,
                               UnknownHostException

  Specified by:
    `createSocket` in interface `org.apache.commons.httpclient.protocol.ProtocolSocketFactory`
  Throws:
    `IOException`
    `UnknownHostException`

### createSocket

    public Socket createSocket(String host,
                               int port)
                        throws IOException,
                               UnknownHostException

  Specified by:
    `createSocket` in interface `org.apache.commons.httpclient.protocol.ProtocolSocketFactory`
  Throws:
    `IOException`
    `UnknownHostException`

### createSocket

    public Socket createSocket(String host,
                               int port,
                               InetAddress localAddress,
                               int localPort,
                               org.apache.commons.httpclient.params.HttpConnectionParams params)
                        throws IOException,
                               UnknownHostException,
                               org.apache.commons.httpclient.ConnectTimeoutException

  Specified by:
    `createSocket` in interface `org.apache.commons.httpclient.protocol.ProtocolSocketFactory`
  Throws:
    `IOException`
    `UnknownHostException`
    `org.apache.commons.httpclient.ConnectTimeoutException`

### setup

    public static void setup()

  Convenience method to set up the necessary HttpClient protocol and URL handler. Only works for HttpClient, because it's not possible (or at least very difficult) to provide a different socket factory for the HttpURLConnection class.

Apache JMeter

Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.