The HTTP HTTP connection pool for persistent connections is described in http://download.oracle.com/javase/6/docs/technotes/guides/net/http-keepalive.html . However, there is no indication that connections are always unloaded from the cache if they are not reused, and if so, what is the length of the timeout.
The only link to this I found the following comments http://www.java.net/forum/topic/performance/general-performance-discussion/reusing-socket-connections-httpurlconnection-0 :
"supported live sockets are timeout. If the server sends a timeout in the HTTP header, then this timeout value is used. Otherwise, the timeout is only 5 seconds, after which the socket will not be reused [...] Unfortunately, you cannot set a timeout, it is hardware in the bowels of the implementation.
If true, this explains some of the odd behavior that we see, and I wrote a small test case that seems to confirm this. (Using Java 1.6.20 for Windows.)
Does anyone know of any documentation on this? In addition, a comment for several years. Is the timeout still hard-coded or can it be set?
. ( , API) . AFAICT , , - keep-alive .
Java 7 , . java 6, , . , keepalive, :
java -Dhttp.keepalive=false ...
:
java -Dhttp.maxConnections=1 ...
System.setProperty(), .
System.setProperty()
, , , , -?
Source: https://habr.com/ru/post/1792590/More articles:ClientClass does not indicate a type. GCC Linux - c ++ANDROID - How to display text on an image? - androidEmacs function to open the file [current date] .tex - functionYii - Module with its UserIdentity component - authentication++ i versus i ++: is there any difference in any modern compiler? - c ++Getting GoogleDoc via API and creating PDF substitution using native text - pythonDetermining the number of lines in a text line? - c #How to debug Android? - androidsubprocess.popen and psql - pythonHow to interact with a website using HttpURLConnection? - javaAll Articles