This content has been marked as final. Show 3 replies
You need to look into how URLConnection and friends do connection pooling, and why they aren't doing it in the case of your sockets.
Ok, with default java factory i got the same problem: Every HttpURLConnection consumes its own socket...
Cant believe there is no way to tell a Java URLConnection to reuse the socket...
It doesn't do that for me. Are you calling disconnect()? That's what closes the underlying socket. If you just close the input stream you should get HTTP 1.1 keep-alive.