Ajax Talk - Asynchronous javascript and xml discussion board
 FAQ   Search    Usergroups      Register   Profile   Check your messages   Log in 
Signup now to enjoy a range of free membership advantages !!
Ajax Talk - Moderators Wanted
Browser Push (hold open Async connection) seems to block oth

 
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> AJAX Help
View previous topic :: View next topic  
Author Message
cdrive
New one
New one


Joined: 02 Sep 2009
Posts: 1

PostPosted: Wed Sep 02, 2009 3:15 pm    Post subject: Browser Push (hold open Async connection) seems to block oth Reply with quote

Hi All,

I am working to implement a browser push ajax/php script to allow notification in the user window via server push. I have all of base php and js working (see below).

The problem is that the hold-open request seems to be blocking other requests (page refreshes in particular) for a few seconds. I believe that the browser is trying to use the open connection and pipeline the new (page refresh) request on top of that connection. This behavior isn't ideal.

js:
Code:

try {
            var xmlHTTP = createXmlHttpRequestObject();
            xmlHTTP.onreadystatechange = function(){
               if (xmlHTTP.readyState == 3) {
                  var data = xmlHTTP.responseText.substr(xmlResponse.length);
                  xmlResponse = xmlHTTP.responseText;
               }
            }
            url = '/ajax/notify.php';
            url=url+"?sid="+Math.random()+" asdf";
            xmlHTTP.open('POST', url, true);
            xmlHTTP.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
            xmlHTTP.send("asdf=123");
         }catch(e){alert(e);}*/


php:
Code:

$count = 0;
while(true){
  $count++;
  echo $count;
  flush();
  sleep(1);
}


Am I missing something?

Thanks in advance!
-Dave
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Ajaxtalk.com Forum Index -> AJAX Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
 Advertisements
 XML & Copyright Notice 
    


Powered by phpBB © 2001, 2005 phpBB Group

What is according to Wikipedia: Ajax Web2.0 XML E4X


Link to our site:

  


del.icio.us digg spurl wists simpy newsvine blinklist furl blogmarks yahoo! myweb smarking ma.gnolia segnalo reddit fark technorati cosmos


Normal Bookmark


Partner Button Links:
Codecrunch.com: Webmaster Tutorials    One Ajax


Partner Text Links:
quomon | web20log | ajaxmatters | tableless | 456bereastreet | music charts | gift ideas | competitions | free xbox 360 | link trade ?


Credits:
it consultancy & project management lead generation zoekmachine optimalisatie steal these buttons seo expert