Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!weretis.net!feeder4.news.weretis.net!storethat.news.telefonica.de!telefonica.de!news-2.dfn.de!news.dfn.de!news.uni-stuttgart.de!news.belwue.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <2104344.5D107XkKLB@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Mon, 21 May 2012 18:31:21 +0200 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 8Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. <645cf917-7fb3-4a7b-9e36-8d03aa4ca965@x10g2000yqg.googlegroups.com> <4fba4b92$0$6961$e4fe514c@news2.news.xs4all.nl> Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 66 NNTP-Posting-Date: 21 May 2012 18:31:22 CEST NNTP-Posting-Host: 5aeacd86.newsspool4.arcor-online.net X-Trace: DXC=c?J`A?mW^9WYQ5E:l "Scott Sauyet" schreef in bericht > news:645cf917-7fb3-4a7b-9e36-8d03aa4ca965@x10g2000yqg.googlegroups.com... > Tom de Neef wrote: >> I found a reference where it says that an open() >> call will close requests still in progress but I can not find >> confirmation. > > Yes: > > | Note: Calling this method an already active request (one for which > | open() or openRequest()has already been called) is the equivalent > of > | calling abort(). > -- Mozilla > > and from the descriptio of the open() algorithm on a XMLHttpRequest > object: > > | 15. Terminate the send() algorithm. > - W3C So you have evidence that it might be so in one DOM implementation because of one Working Draft (or vice-versa). That does not mean anything for the rest of XHR-supporting runtime environments. >> I imagine that the script is run in a single thread, so how are >> successive calls to informServer handled by processAsyncResponse()? > > Everything would proceed fine until a second open() call is made when > the first is processing. > > If you want to use a fixed pool of XMLHttpRequest objects (or even > just one, as you are doing) then you really need to determine if the > object is in process before you call open() again. > > I've never really bothered. Just constructing new instances has not > caused me noticeable issues. ^^ (sic!) Of course, creating new objects when not needed will unnecessarily consume resources that could be more useful elsewhere. And as garbage collection is not performed instantly (if at all), one should be wary to create new objects. > Thank you. > Note PE's references: there is a limit (of two) to the number of > XMLHttpRequest objects alive. No, you misunderstood. I have only pointed out that the number of simultaneous connections from the same HTTP client to the same HTTP server or proxy is supposed to be limited. XHR merely provides an interface to the runtime environment's HTTP client. I think we can accept as an axiom here that the number of XHR objects that can exist in a program simultaneously is – just like that of other objects – only limited by the amount of available memory. PointedEars -- realism: HTML 4.01 Strict evangelism: XHTML 1.0 Strict madness: XHTML 1.1 as application/xhtml+xml -- Bjoern Hoehrmann