HttpURLConnection, as a HTTP 1.1 client has an in built keep-alive implementation to handle persistent connections. This has been around in previous releases, but mustang beta brings one significant improvement to this. The ability to reuse connections where not all of the response body has been read. This issue was at one time in the top 10 of the top 25 Bugs , with 117 votes against it.
We have implemented an asynchronous cleanup of unread response body from the underlying socket. So if the InputStream is closed before all of the response body is read, its underlying TCP connection is put on a queue so that the remaining data can be read and then the connection put into the keep-alive cache. The queue is serviced on demand by a thread, Keep-Alive-SocketCleaner. So if you see this thread you will know what it is doing.
Since different applications have different requirements, and depending on your network speed, you may want to tune this feature. We have made this available through the network properties http.KeepAlive.remainingData and http.KeepAlive.queuedConnections in ../jre/lib/net.properties.
# HTTP Keep Alive settings. remainingData is the maximum amount of data
# in kilobytes that will be cleaned off the underlying socket so that it
# can be reused (default value is 512K), queuedConnections is the maximum
# number of Keep Alive connections to be on the queue for clean up (default
# value is 10).
# http.KeepAlive.remainingData=512
# http.KeepAlive.queuedConnections=10
We have taken 512K as the default value for the maximum amount of data remaining to be read. That is, if there is <= 512K of unread response body on the InputStream then it will be queued for async cleanup, otherwise the underlying socket will be closed. This value was chosen as an approximate cost of creating a new connection but may vary depending on the connection type, for example, HTTPS connections can take sometime to perform the SSL handshake.
http.KeepAlive.queuedConnections is simply to ensure that the queue does no grow out of all proportion. If you are planning to make use of this feature in your code (or maybe you're using 3rd party code and don't have a choice ) you may want to increase this default value.

amasya
Posted by amasya on September 11, 2008 at 06:58 PM GMT+00:00 #
hemşire
Posted by hemşire on September 11, 2008 at 06:58 PM GMT+00:00 #
özelgüvenlik
Posted by özel güvenlik on September 11, 2008 at 06:59 PM GMT+00:00 #
thank you
Posted by güvenlik on October 07, 2008 at 06:34 PM GMT+00:00 #
thank you
Posted by camfrog on October 31, 2008 at 08:50 AM GMT+00:00 #
thanks
Posted by travesti on March 07, 2009 at 09:28 PM GMT+00:00 #
thanks
Posted by travesti on March 07, 2009 at 09:29 PM GMT+00:00 #
thanks
Posted by seo on March 07, 2009 at 09:30 PM GMT+00:00 #
sdsfsdfsdfsdfsdsdf
Posted by göğüs büyütücüler on June 22, 2009 at 11:00 PM GMT+00:00 #
dsfsdkfsdfkjsdfjds
Posted by göğüs büyütücü krem on June 22, 2009 at 11:00 PM GMT+00:00 #
<a href="http://www.gogusubuyutmek.com"title="göğüs büyütücü">göğüs büyütücü</a>
Posted by göğüs büyütücü on June 22, 2009 at 11:01 PM GMT+00:00 #
laser hair remowal (lazer epilasyon) information pages: http://www.lazerepilasyon.org/
Posted by lazer epilasyon on August 12, 2009 at 07:18 PM GMT+00:00 #
saç ekimi ve saç ekimi merkezi: http://www.sacekimi.tv/
Posted by saç ekimi on August 12, 2009 at 07:19 PM GMT+00:00 #
saç ekimi fut and saç ekimi fue hair transplant center: http://www.bogazicisacekimi.com/
Posted by saç ekimi on August 12, 2009 at 07:20 PM GMT+00:00 #
Cool!
Posted by Zanix IT on September 06, 2009 at 04:18 PM GMT+00:00 #
thank you.
escort bayan
bayan escort
escort bayanlar
Posted by escort bayan on October 31, 2009 at 09:21 PM GMT+00:00 #