I need to know the best (fastest) way to have a server (preferably a php based one, but a jsp/servlet one could be set up as well using google app engine) notify several java applets/applications that a change has occurred to the data.
The way i am picturing this to work will be very similar to that of the way i think an online java game (like Runescape) works
User 1: Changes data on server.
Server: returns success to User 1, notifies connected computers of change.
Connected Computer 1: processes change, returns success to server.
Connected Computer 2: processes change, returns success to server.
Connected Computer 3: processes change, returns success to server.
Connected Computer 4: processes change, returns success to server.
I am hoping to have this entire process complete in half a second, and not involve polling as there will be long durations of nothing, followed by a sudden moment where 4 events happen in succession.
If it has to be very fast and reliable, I wouldn’t use a web server at all. I’d have a stand-alone server process and have the clients make direct TCP connections to it. More application are using a push from a web server, but I still find it very unreliable. Each client would need a thread that blocks on a socket read. They will get the data immediately when it arrives on the client system.