I am trying to make Comet requests via Prototype/php like here : http://www.zeitoun.net/articles/comet_and_php/start
But!!! While con开发者_如何学JAVAnection is open, other pages from my project is not loading from the same browser. What can I do to provide normal behaviour?
Very very tnx
Comet works by keeping a connection open between the server and the client. Browsers have a maximum number of connections that they will allow a page to make (something like 2 max for IE), I think it might also group all requests for the same domain together. That is why connections are not going through for you.
I believe it is not the server that is at fault here it is the browsers, using an iframe is the correct solution here as you mentioned, but it's not the servers fault.
[Edit] Simplest solution for you is to monitor focus. When the page has focus, open a connection, when it is lost(ie. user switches tabs) close the connection and wait for focus again before updating the page. That way you will have the appearance of multiple pages updating while only needing 1 comet connection at any time.
精彩评论