does firefox have alimit on the number of loops dne with settimeout?

B

back_ache

Hi,

I have created a script that needs to constanstly poll a webpage, I do
this with a controling function that fires off different functions to
do the work, then restarts by calling itself after a second using
settimeout.

on IE it runs forever, on firefox it stops after a while,

what am I doing wrong?
is there a limit on the number of times you can go around this type
loop you can go around in firefox?
if there is a limit, how do I get around it?

Would it be freak out if the function is already running when it is
fired again?
 
O

ozfred

Hi,

I have created a script that needs to constanstly poll a webpage, I do
this with a controling function that fires off different functions to
do the work, then restarts by calling itself after a second using
settimeout.

on IE it runs forever, on firefox it stops after a while,

what am I doing wrong?

Who knows? Where's the code?

is there a limit on the number of times you can go around this type
loop you can go around in firefox?
No.


if there is a limit, how do I get around it?

There is not limit, so there's nothing to "get around". ;-)

Would it be freak out if the function is already running when it is
fired again?

You can't call it while any other script is running. JavaScript is
single-threaded, if something else is running when setTimeout wants to
run, the call will be put in a que until its turn comes around.

At a guess, you are overloading the number of HTTP requests that
Firefox can make simultaneously - but that is just a guess.
 
L

Laurent Bugnion

Hi,

(e-mail address removed) wrote:
At a guess, you are overloading the number of HTTP requests that
Firefox can make simultaneously - but that is just a guess.

From our tests, the limit in Firefox is the same as in IE, that's 2
concurrent HTTP connections.

For IE:
http://blogs.msdn.com/ie/archive/2005/04/11/407189.aspx

For Firefox, it's quite easy to test by creating a web service sleeping
on the server, and having two windows call that service. When you open
the 3rd window, the request doesn't go through until one of the two
others expires (timeout) or comes back from the server.

HTH,
Laurent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top