问题

As shown in the image, if client1 sends some information to server, and on other side client2, client3, client4 also opened the same page to which client1 made changes, I want to show those changes to all users who are on that same page.
We can do the following:
- Make call to server at some interval
- Node.js
I am using Java, can this be done using sockets?
My idea is that client1's changes will be received by client2, client3, client4 by some kind of notification and only then will they call the server to get the desired changes.
How can this be achieved?
回答1:
take a look at akka -> akka provides the ability to build Asynchronous applications using Java. And yes you can make a very efficient solution for this using websockets+akka .
You can find an example of how to do this in Sample application (websocket-chat) for Play Framework which uses akka+websockets for making an asynchronous chat application.
来源:https://stackoverflow.com/questions/10563623/communication-between-all-browsers-opened-for-a-particular-web-site-from-server