/*
 * Copyright 2005 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 */

package org.apache.jmeter.protocol.http.util;

import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;

import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
import org.apache.jmeter.util.SlowSocket;

/**
 * HttpClient protocol factory to generate "slow" sockets for emulating dial-up modems 
 */

public class SlowHttpClientSocketFactory implements ProtocolSocketFactory {

    private final int CPS; // Characters per second to emulate

    /**
     * 
     * @param cps - characters per second
     */
    public SlowHttpClientSocketFactory(final int cps) {
        super();
        CPS = cps;
    }

    public Socket createSocket(String host, int port, InetAddress clientHost,
            int clientPort) throws IOException, UnknownHostException {
        return new SlowSocket(CPS,host,port,clientHost,clientPort);
    }

    public Socket createSocket(String host, int port) throws IOException,
            UnknownHostException {
        return new SlowSocket(CPS,host,port);
    }
}

/*
 * Copyright 2005 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 */

package org.apache.jmeter.protocol.http.util;

import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;

import org.apache.commons.httpclient.ConnectTimeoutException;
import org.apache.commons.httpclient.params.HttpConnectionParams;
import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
import org.apache.jmeter.util.SlowSocket;

/**
 * HttpClient protocol factory to generate "slow" sockets for emulating dial-up modems 
 */

public class SlowHttpClientSocketFactory implements ProtocolSocketFactory {

    private final int CPS; // Characters per second to emulate

    /**
     * 
     * @param cps - characters per second
     */
    public SlowHttpClientSocketFactory(final int cps) {
        super();
        CPS = cps;
    }

    public Socket createSocket(String host, int port, InetAddress clientHost,
            int clientPort) throws IOException, UnknownHostException {
        return new SlowSocket(CPS,host,port,clientHost,clientPort);
    }

    public Socket createSocket(String host, int port) throws IOException,
            UnknownHostException {
        return new SlowSocket(CPS,host,port);
    }

    public Socket createSocket(String arg0, int arg1, InetAddress arg2, int arg3, HttpConnectionParams arg4) throws IOException, UnknownHostException, ConnectTimeoutException {
        // TODO Auto-generated method stub
        return null;
    }
}

Add dummy implementation of abstract method from httpclient 3.0