9 Replies Latest reply on Aug 9, 2013 10:17 AM by masijade

    Server socket stress test?


      We have a server socket running.  We have simple client programme as below. We would like to do a stress test on our server socket by running the codes below. How can we achieve a parallel effect with the following codes? Normally what limitation will the socket application have e.g. number of socket per minute etc?


      public class stress1 extends Thread {

      public static void main(String[] argv) {

      try {

         for (int i = 0; i < 5000; i++) {

              Socket socket = new Socket("localhost", 18000);

              PrintWriter out = new PrintWriter(socket.getOutputStream(), true);

              BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));

              out.println("data to my server ");

              System.out.println(in.readLine() + i);





          } catch (Exception e) {