[rfc][icedtea-web] disconnecting httpurlconnections
Adam Domurad
domuradical at gmail.com
Sat May 24 16:05:34 UTC 2014
Omair Majid <omajid at ...> writes:
>
> * Jiri Vanek <jvanek at ...> [2014-05-02 09:34]:
> > I will elaborate a bit more, but if you may say few more words, it
> > would be nice:((
>
> Sorry, but I know next to nothing about this area. All I know is that
> Adam looked into it and decided that disconnect() is best avoided.
I came to the conclusion from reading the likes of this:
"Each HttpURLConnection instance is used to make a single request but the
underlying network connection to the HTTP server may be transparently shared
by other instances. Calling the close() methods on the InputStream or
OutputStream of an HttpURLConnection after a request may free network
resources associated with this instance but has no effect on any shared
persistent connection. Calling the disconnect() method may close the
underlying socket if a persistent connection is otherwise idle at that time."
If we are done speaking to a certain HTTP server, 'disconnect' seems to make
sense. If we are doing a HEAD attempt, and then a GET attempt, it does not.
Please feel free to ask if you are wondering about decisions I made; they
were based on advice from the likes of StackOverflow and not from prior
familiarity.
>
> Thanks,
> Omair
>
Thanks,
-Adam
More information about the distro-pkg-dev
mailing list