问题
I am working on a web application which can serve only one client.Now I need to include functionality to serve multiple clients. For that one mechanism should be there in which all the clients can see OR will be notified if any changes are done by some another client in the application. So my job is now to notify all the clients once any changes are done from the back end by another client.
I found one solution in which I will call one cgi script from javascript at a particular period of time and it will let the other users know about the notifications done (i.e by alerts). But I think that it will be an overhead to server to continuously call that script repeatedly. Is there any other solution in which I can resolve my purpose ???
Thanks in advance...
回答1:
This depends a lot on your server side technology, but what you are probably after is something like Javascript Comet (Wikipedia)
There is a thread on StackOverflow here talking about Comet
来源:https://stackoverflow.com/questions/7567462/handle-web-server-with-multiple-clients