PDA

Click to See Complete Forum and Search --> : Simple programm needed


Dr Toker
March 16th, 2002, 05:17 PM
I am in need of a program that opens a specified number of TCP/Ip winsockets and runs a cgi, or a php....dont know but i think i would need to submit a cookie with each winsock connection.

This wouldnt be too difficult if I had some programming skills. But i am powerless in the world of programming.

Any help would be appriciated....

proactive
March 16th, 2002, 05:42 PM
Hmm, you want to stress-test a web-application?

Guus
March 16th, 2002, 05:48 PM
When you say you 'need to run a cgi or a php,' do you mean you want to read websites that are composed using cgi or php, or do you want to compose those websites yourself?

Dr Toker
March 16th, 2002, 07:17 PM
Take a cgi script.....copy to clip board...paste in address bar. Click go, and it will run that CGI.
I want to do this without opening my browser. and like 50 sockets at a time.:)

proactive
March 16th, 2002, 07:35 PM
Here is a solution for you: Put your cgi on a web-server that resides on one machine. Then start up WebLoad (http://www.radview.com/download/index.asp) on another machine that is connected to the web-server. The WebLoad program will simulate users by using simple javascript created by a wizard. You say you want 50 simultanious users, well be prepared to run at least a dual-processor on the server. If the cgi's do much work, that is.

Hope this helps.

Guus
March 16th, 2002, 07:54 PM
I think this would do the trick too. Save this in a file called TryUrl.java, compile it, and run it.
I'm no java expert - maybe someone can check my code?

import java.net.URL;
import java.io.InputStream;

public class TryUrl {
public static void main (String[] args) {
// this opens 6 threads, add more if desired...
new SimpleThread("Thread 1").start();
new SimpleThread("Thread 2").start();
new SimpleThread("Thread 3").start();
new SimpleThread("Thread 4").start();
new SimpleThread("Thread 5").start();
new SimpleThread("Thread 6").start();
}
}

class SimpleThread extends Thread {

URL inUrl;
InputStream stream;

public SimpleThread(String str) {
super(str);
}
public void run() {
try {
inUrl = new URL("http://www.yoursite.com/index.php?withsomevariable=thisvalue");
stream = inUrl.openStream();
System.out.println("DONE! " + getName());
} catch (Exception e) { System.out.println("ERROR! " + e); }
}
}

Dr Toker
March 16th, 2002, 11:36 PM
I need to take a programming class...thats all there is to it....