Comet ("Server Push" technology based on HTTP long connections)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.