When I use URLConnection to do some HTTP requests, I could only close InputStream and OutputStream, but not the socket.
Does the class automatically close the socket? How does it do it? Will the server return a FIN or something else?
If I produce many threads including each URLConnection in them, will it automatically reuse the socket? I caught some packages, it shows about every 3 connections share 1 socket.