?
Solved

Check internet access

Posted on 2011-10-13
5
Medium Priority
?
216 Views
Last Modified: 2012-06-21
Please let me know what is the simplest way to check if the machine has internet access through Java code.

Thanks!
0
Comment
Question by:dshrenik
  • 3
  • 2
5 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 2000 total points
ID: 36963988
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36963992
Just try to open HTTPcopnnection to www.google.com
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36964007


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
0
 

Author Comment

by:dshrenik
ID: 36964037
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!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This video teaches viewers about errors in exception handling.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month16 days, 11 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question