I'm building a website which consists of JSP pages and a gaming Applet talking to a Servlet hosted on Tomcat 4.0.
All is working well, but scalability is going to be a major issue.
The problem lies with the request - response http protocol. First Applet sends their move to the Servlet. The Servlet has no way of letting the opponent's applet know it's received the next move so the opponents applet has had to constantly poll the servlet to see if a move has been delivered. When a poll returns the move, the original applet is now hammering the servlet waiting for the next move.
Currently my only HTTP solution is to tell the applets to poll only once every 5 seconds to reduce requests. If I use normal sockets I can have controlled 2 way communication (the applet can sleep until it's told there's a move), but it won't got through firewalls - and why would you go to work if you couldn't play once there?!
Do you know of a suitable solution to this problem?
Grant.
All is working well, but scalability is going to be a major issue.
The problem lies with the request - response http protocol. First Applet sends their move to the Servlet. The Servlet has no way of letting the opponent's applet know it's received the next move so the opponents applet has had to constantly poll the servlet to see if a move has been delivered. When a poll returns the move, the original applet is now hammering the servlet waiting for the next move.
Currently my only HTTP solution is to tell the applets to poll only once every 5 seconds to reduce requests. If I use normal sockets I can have controlled 2 way communication (the applet can sleep until it's told there's a move), but it won't got through firewalls - and why would you go to work if you couldn't play once there?!
Do you know of a suitable solution to this problem?
Grant.