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.