Lets say we have a web based application where users login to their own channel.
And our server manages and maintains a list of users, and their current ip addresses.
When someone logs in, is it possible for each client to receive a notification of this users login? Equally if someone logs out, a similar notification would be generated.
(Useful for maintaining a list of online friends).
IE: is it possible for the server to send some sort of packet to each client, or for the client machine (the guy who logs in/out) to communicate to all other client machines.
Just looking for thoughts on the subject.
If you know a good framework for this sort of functionality id like to hear about it.
AJAX or JQuery spring to mind, but are these technologies useful for this sort of thing?
Thanks guys…
Yes. Comet is meant for this. Here is a jQuery plugin. And this answer can be useful. Or you can simply ajax-poll the server at a given rate and it will serve changes.
That’s from on the client side. The server is simply serving the current state it holds (either in memory, or in a database). However one should give special attention to the case when multiple servers work in a cluster. In that case they should either replicate their memory, or use a “hard” storage (database), so that changes are propagated to all nodes.