public static void main(String[] args) throws Exception {
        if (args.length < 1) {
            //System.err.println("Usage: java " + CometServletClientTest.class.getName()
            //        + " URL [n] [max] [delay]");
            System.err.println("Usage: java " + CometServletSSLClientTest.class.getName()
                    + " URL [n] [delay]");
            System.err.println("\tURL: The url of the service to test.");
            System.err.println("\tn: The number of threads. (default is " + NB_CLIENTS + ")");
            // System.err.println("\tmax: The maximum number of requests. (default is 1000)");
            System.err.println("\tdelay: The delay between requests. (default is 1000ms)");
            System.exit(1);
        }

        URL strURL = new URL(args[0]);
        int delay = DEFAULT_DELAY;

        if (args.length > 1) {
            try {
                NB_CLIENTS = Integer.parseInt(args[1]);
                //if (args.length > 2) {
                //    max = Integer.parseInt(args[2]);
                //    if (max < 1) {
                //        throw new IllegalArgumentException("Negative number: max");
                //    }
                //}
                if (args.length > 2) {
                    delay = Integer.parseInt(args[2]);
                    if (delay < 1) {
                        throw new IllegalArgumentException("Negative number: delay");
                    }
                }
            } catch (Exception exp) {
                System.err.println("Error: " + exp.getMessage());
                System.exit(1);
            }
        }

        System.out.println("\nRunning test with parameters:");
        System.out.println("\tURL: " + strURL);
        System.out.println("\tn: " + NB_CLIENTS);
        //System.out.println("\tmax: " + max);
        System.out.println("\tdelay: " + delay);
        
        InputStream in = CometServletSSLClientTest.class.getResourceAsStream("ssl-config.properties");                
        System.getProperties().load(in);
        
        String home = System.getProperty("user.home");
        String trustStoreFileName = System.getProperty("javax.net.ssl.trustStore").replace("~", home);
        System.setProperty("javax.net.ssl.trustStore", trustStoreFileName);
        String keyStoreFileName = System.getProperty("javax.net.ssl.keyStore").replace("~", home);
        System.setProperty("javax.net.ssl.keyStore", keyStoreFileName);

        Thread clients[] = new Thread[NB_CLIENTS];
        for (int i = 0; i < clients.length; i++) {
            clients[i] = new CometServletSSLClientTest(strURL, delay);
        }
        for (int i = 0; i < clients.length; i++) {
            clients[i].start();
        }
        for (int i = 0; i < clients.length; i++) {
            clients[i].join();
        }
    }