C
Christophe Darville
Hello,
I got an ip caching problem when using HttpUrlConnection class.
When using the code :
URL url = new URL("http://a.domain");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
The VM seems to cache the ip address associated with the domain "a.domain".
If the ip associated with this domain change, the VM still connect to the
old ip. The only way to connect to the new ip, is to restart the VM.
I have tried
java.security.Security.setProperty("networkaddress.cache.ttl", "0");
but it does not work with HttpUrlConnection (it works fine with InetAddress
class for instance).
Any idea ?
Thank you,
Christophe
I got an ip caching problem when using HttpUrlConnection class.
When using the code :
URL url = new URL("http://a.domain");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
The VM seems to cache the ip address associated with the domain "a.domain".
If the ip associated with this domain change, the VM still connect to the
old ip. The only way to connect to the new ip, is to restart the VM.
I have tried
java.security.Security.setProperty("networkaddress.cache.ttl", "0");
but it does not work with HttpUrlConnection (it works fine with InetAddress
class for instance).
Any idea ?
Thank you,
Christophe