This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I am writing a loadtester for our application, and I am testing against IIS/Tomcat versus Apache webserver/Tomcat. I am threading connections to the webserver by opening a socket and writing to the outputstream.
Socket server = ..... OutputStream toServer = server.getOutputStream(); toServer.write(request);
My question is probably more on the webserver side, is this an appropriate way to handle sending requests to a webserver? If I create a multi-threaded application and send 500 different requests using sockets, is this the same as 500 client browser requests, as far as the webserver is concerned?
Much better to use a toolkit that really simulates a browser. I like HttpClient from the Apache commons project. With a little work you can simulate more complex interactions. Since Httpclient handles cookies you can use session logic.