Subj : Re: Threading in JavaScript To : comp.lang.javascript,netscape.public.mozilla.jseng From : "Fotios" Date : Fri Feb 07 2003 12:40 pm > > If you use asyncronous mode you can download as many files as you > want. True, on a strictly technical level, the callbacks will be > processed syncronously because javascript is single threaded, but > there's nothing you can do about that and you'll have that problem > with any solution that involves javascript. > http://msdn.microsoft.com/library/en-us/xmlsdk/htm/xml_mth_or_4to4.asp > > The other thing to consider is that the HTTP 1.0 and 1.1 > specifications allows for four and two socket connections respectively > per server, per process. You can spawn 100 threads and make 100 > requests if you want; however, all but 4/2 will be blocked unless they > are made in different processes. There is a registry key that you can > set to increase the client-side limit but, if I remember right, > neither cannot be set higher than 16. > http://support.microsoft.com/default.aspx?scid=kb;en-us;183110 > > I use XMLHTTP along with setTimeout and setInterval in my pages -- I > make 10-15 requests every 5 seconds or so -- and it works really > nicely. I'm on an intranet with a responsive server though so the > HTTP limit doesn't really affect me. If you're developing for an > internet site you might have some trouble because of the higher > latency. The above, along with the post about many http servers allowing only 2 connections per client IP, is all excellent and accurate advice. The other thing to consider is that xmlhttp may not allow or prompt the user when out of domain access is attempted (access to domains other than the one the current page belongs to). Applets are still prone to such security restrictions but they can overcome them by being signed. Good luck, Fotios http://www.nkd-webmedia.co.uk/ .