Comet-php program blocking problem

Source: Internet
Author: User
In a comet function, the second request is a request to obtain information, and the program keeps blocking the Code: then the third request triggers the condition in html and then initiates a request. The third request will be executed only after the second request is executed. Why? Php...


In a comet function, the second request is a request to obtain information, and the program has been congested.
Code:

Then the third request triggers the condition in html and then initiates a request.

The third request can only be executed after the second request is executed. Why?

I encountered this problem when I was working on the php comet function ....

What's the problem?

Reply content:


In a comet function, the second request is a request to obtain information, and the program has been congested.
Code:

Then the third request triggers the condition in html and then initiates a request.

The third request can only be executed after the second request is executed. Why?

I encountered this problem when I was working on the php comet function ....

What's the problem?

Take a look at the timeline. The third request should be waiting for the status to be issued (Blocking). The second request will be sent from the browser after it is completed.

Generally, the previous request returns Connection: keep-alive, but the response is not complete.
Subsequent same-source requests will wait until the tcp link is released by the previous request and becomes available.

Http://leeon.me/a/persistent-link-poll-ajax-requests-with-php
I answered this question myself... read this article.

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.