How update messages are displayed

I would like to know how update messages were implemented on this crowded stack.

To be more precise, for example, while I try to answer a question, and I am in the middle of entering my answer, I will see a message on top of the page in which a new answer is added. How this function was implemented.

AFAIK, a possible way could be HTML5 websocket or serversocket technology. is there any other way to achieve such a push notification system, especially using java, spring and jquery?

Not sure how to tag this question. correct the tags if I am wrong.

+4
source share
3 answers

I have successfully used the Direct Web Remoting framework. ( DWR ).

+2
source

SO uses reverse ajax / comet technology to display these messages. I remember that I read some meta discussions about this function, I could not exactly find the link to it at the moment. Will be updated as soon as I find.

Based on the name of the programming language, the name (websockets (or) socket.io, etc.) may change, but in the end they are all from a cometary structure.

Update:

Here is a SO meta discussion on this topic.

+6
source

There are several ways to achieve this:

  • Survey : With jQuery, you regularly send a query (every 5 seconds for examples) that retrieves updates from the server.
  • Streaming : you issue a request, the server does not set the Content-Length for the response, and never closes the socket. This way you can send data from the server to the client whenever you want. But this means that for each client, the connection is supported by your server.
  • Long-term survey : a combination between the two previous methods. The connection is made by the server, but with a timeout. If new data is not available, the server closes the connection and the client instantly opens a new one.

Thoses - Push Technologies: http://en.wikipedia.org/wiki/Push_technology

Of course, there are ways to achieve this.

+2
source

Source: https://habr.com/ru/post/1438674/


All Articles