Comet ("Server Push" technology based on HTTP long connections)
The Web server sends the data passively to the client, the client requests it, the server responds (sends the data),
So the "server push" technique adds quotes.
There are two ways to achieve this:
1. Ajax-based long polling (long-polling) mode
The browser sends an AJAX request (sets a timeout and processes the returned state,
Conjecture: Setting the timeout,connection:keep-alive will be added to the request header, which is based on the HTTP long connection),
If the time is up, the HTTP connection is broken (the underlying TCP connection is broken) and the request is re-initiated.
2. Stream (streaming) mode based on Iframe and Htmlfile
A hidden Frame (IFRAME) is moved into the page, the src attribute of the hidden frame is set to a long connection request, and the server can send data to the client.
Concrete implementation: http://www.cnblogs.com/AloneSword/p/3517463.html
Comet ("Server Push" technology based on HTTP long connections)