A thing i've been meaning to ask you pro networking guys.
A new URL connection opens a socket for each request to a server right?
Browsing through the bytecode (sourcecode seems missing) it seems that sun.net.www.http.HttpClient.New()
is able to reuse existing TCP connections.
Any way to use the http protocol without having to always open a new connection?
Yes, HTTP/1.1 supports multiple (sequential) requests/responses.
I'm already using Executors and some application heuristics, but there can be 6 connections (threads) at a time for responsiveness.
It's would be a shame if you have 6 connections to a slow/overloaded server, while you were interested in many files from many servers. I suggest you change it, to (max) 6 connections to each server. For proper performance of small request (like dozens of thumbnails), it's very important to keep the same TCP connection, to sustain/increase bandwidth, as each TCP connection starts out relatively slow.