0

I'm building a web application (a card game) which needs 4 players to play. I used servlets for server side and knockout js for client side. I'm using tomcat server and I just ran it on localhost when implementing. Now I want to see whether it works by connecting 4 players. How do I do it in a single computer? Are there any tools for this task?

Can't I connect with multiple clients in the same machine? Do I definitely need multiple machines? Can someone please give a tip?

Pedro del Sol
  • 2,840
  • 9
  • 39
  • 52
  • Just install and run multiple clients. E.g. Chrome, Firefox, Safari, Opera, IE, etc. Some of them also support an "incognito tab/mode", which essentially creates a new HTTP session and therefore represents another client. – BalusC Apr 16 '16 at 11:10
  • Aren't servlets creating threads for each client based on their IP? In this case if I use multiple browser windows will be the same. I tried this and the responses are same for all clients which shouldn't be the case for multiple clients. –  Apr 16 '16 at 11:17
  • Then your servlet is not thread safe, meaning you have bigger problems. On the other hand, "multiple browser windows" != "multiple clients/sessions". Make sure you understand this and eliminate the ambiguity. This must be helpful in understanding how servlets work: http://stackoverflow.com/q/3106452 – BalusC Apr 16 '16 at 11:18
  • "On the other hand, "multiple browser windows" != "multiple clients/sessions"." But you said in your first comment that browsers with incognito mode creates new http session and therefore multiple clients. What I meant by multiple browser windows are those incognito windows –  Apr 16 '16 at 11:26
  • You didn't literally said that. I was just trying to eliminate ambiguity because you never know with starters like you. Well, as far as it looks like, your servlet is definitely not thread safe. Read that link to grasp the basic concepts. – BalusC Apr 16 '16 at 11:30
  • Alright. Thanks for the answer –  Apr 16 '16 at 11:33

0 Answers0