dshrenik
asked on
Check internet access
Please let me know what is the simplest way to check if the machine has internet access through Java code.
Thanks!
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just try to open HTTPcopnnection to www.google.com
You can use this example to open connection (but can use even some more reliable site, like Google):
http://www.java2s.com/Code/JavaAPI/javax.net/URLopenConnection.htm
ASKER
Can you tell me how I can turn of DNS caching in the Java runtime.
The solution here says that I must do that to be on the safer side:
http://stackoverflow.com/questions/1139547/detect-internet-connection-using-java
Thanks!
The solution here says that I must do that to be on the safer side:
http://stackoverflow.com/questions/1139547/detect-internet-connection-using-java
Thanks!
ASKER
Please answer the question here:
https://www.experts-exchange.com/questions/27395513/Turn-of-DNS-caching-in-the-Java-runtime.html
https://www.experts-exchange.com/questions/27395513/Turn-of-DNS-caching-in-the-Java-runtime.html