Typically, the browser checks the server for new messages. One approach that is often done to increase efficiency is long poll '(see also this link ) - the server responds immediately if it has anything; otherwise, it waits until the connection is open. If a message arrives, he immediately wakes up and sends it, otherwise he returns with "no, checks back" in a few tens of seconds. The client immediately dials the number to return to the state of a long survey.
source
share