When I use URLConnection to execute some HTTP requests, I can only close InputStream and OutputStream, but not the socket.
Does the class automatically close the socket? How it's done? Will the FIN server return or something else?
If I create many threads, including every URLConnection in them, will it automatically reuse the socket? I caught several packets, it shows that every three connections use one socket.
source
share