Depending on the actual problem, it isn't really a Servlet or Java question.
Secondly, clients and servers tend to limit the connections allowed to prevent one page or client hogging the system. Hence even if you managed to force many connections to be created from the client, the third onwards may be blocked until the first ones finish.
posted 13 years ago
If the client in your case is browser then you cannot do anything , you cannot enforce and restriction from the server side.
As establishing TCP/IP connection is a costly affair , so it keep the connection open and uses the same for getting other resources for constructing the page.Now sure whether browsers use multthreading for requesting multiple resources at a time.
Are you certain that the problem is not one of limited bandwidth - how big are the images, and what kind of connection is used?
Also, I don't think a browser would use N download threads to download N images. For a given web page, I think no more than about 4 threads are used by default. Some browsers have a setting for this.
As to addressing the problem on the server, typical web containers like Tomcat already use a pool of threads to handle requests. So if 20 requests come in (unlikely, see above) the server might well be using 20 threads to serve them. The same is true if the images aren't static, but are generated dynamically by a servlet (which is multi-threaded by nature, unless SingleThreadModel or synchronization is used). [ May 04, 2007: Message edited by: Ulf Dittmer ]
Everyone is a villain in someone else's story. Especially this devious tiny ad: