• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

AJAX - multiple requests, etc.

 
Ranch Hand
Posts: 409
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just ran a simple test, in which I delayed an AJAX response by 8-9 minutes. My test caused my machine to heat up, but that's another story. (It was a very simple delay mechanism.)

1. I take it that if I initiate an AJAX request, it will not time out? It is up to the programmer to end an AJAX session?

2. I tried sending two responses back through the same path, and got an error on page. Is there any way to leave the connection open for multiple responses? Or does a new request need to be initiated to accept a future response?

3. I've read that browsers only allow 2 active AJAX sessions. How do I assure that the ones I want are active? i.e. from the above - I might speculate that an AJAX session is closed when a response is returned. So as long as I do not initiate another request while two are in process, things should be peachy, right?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

1. I take it that if I initiate an AJAX request, it will not time out? It is up to the programmer to end an AJAX session?



Yes you would have to build a timer and cancel it with the abort() method. Leaving a connection open is the basis of COMET.

2. I tried sending two responses back through the same path, and got an error on page. Is there any way to leave the connection open for multiple responses? Or does a new request need to be initiated to accept a future response?



You can not do "socket" type of connections where you can just send data data and forth since we are dealing with http. You need to create a new connnection each time.

3. I've read that browsers only allow 2 active AJAX sessions. How do I assure that the ones I want are active? i.e. from the above - I might speculate that an AJAX session is closed when a response is returned. So as long as I do not initiate another request while two are in process, things should be peachy, right?



IE has always had the limit of two connections to the server at a time. To change that, you would have to edit the registry entry that controls that.You can really see the two connection restriction on IE when you are on dialup. How the images load sequentially down the page.

Firefox allows for more, faster fox extension changes the number.

One thin to point out is if you have two connections sitting there to the server, that means it is clossing it up for other things such as images. There are some ways around it for static content, but that is a different topic.

Eric
 
Roger F. Gay
Ranch Hand
Posts: 409
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Eric. That's exactly the info I needed. I can use old school reverse ajax through an invisable iframe, but don't know if that runs into the same limitations. In the short-term, I'm just doing a simple demo and can live with the two connection limit. But it would be interesting to know.
 
reply
    Bookmark Topic Watch Topic
  • New Topic