/*
 * 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);
    }
}

@@ -778,16 +778,144 @@
 ption;%0A%0A
+import org.apache.commons.httpclient.ConnectTimeoutException;%0Aimport org.apache.commons.httpclient.params.HttpConnectionParams;%0A
 import o
@@ -1805,11 +1805,259 @@
 );%0A    %7D
+%0A%0A    public Socket createSocket(String arg0, int arg1, InetAddress arg2, int arg3, HttpConnectionParams arg4) throws IOException, UnknownHostException, ConnectTimeoutException %7B%0A        // TODO Auto-generated method stub%0A        return null;%0A    %7D
 %0A%7D%0A

Add dummy implementation of abstract method from httpclient 3.0