I've been trying to work out how to approach this problem but I don't know where to start.
I have an game applet written in Java that I'm trying to make multi-player across a network. At the moment it is a standalone application but eventually it needs to be on some sort of web page where clients can access it through a browser and play against each other.
I was thinking that each clients applet could communicate using sockets with an applet that runs constantly on a tomcat server. This applet on the server would handle incoming socket connections, create new threads to handle each connection, maintain a list of connected clients, and set up games. Clients could also get information from a database about past games etc. by communicating with the server.
For example I want a client to be able to start a game. Then other clients are notified that he has started a game and can join the game. Then when the host clicks start game, all the other clients are notified and the game begins in their applet. Whoever solves the puzzle first would then click finished. His score would be sent to the server applet which then forwards the result to each client connected.
So i have some questions
Does this sound like a reasonable plan?
How does tomcat assist with this?
How would i deploy it to tomcat? I'm doing this in eclipse and have set added a local tomcat server. Do i just run the class on the server with eclipse, then socket connect to http://localhost/packagename/classname on the applet?
What classes would the servlet need to extend to make it connectable? Since connections will be made from an applet should the servlet be a Non-Http Servlet?
Can you recommend some documentation or provide some example code of a client applet communicating with a server applet using tomcat? All the examples I've seen are just html forms that pass information to a servlet using Http.