Hi Frnds,
I wanna to write a prog to check whether internet is
connected or not.
I tried using URL api or pinging Google
but in both the cases i was not satisfied with the
solution.
can anyone provide me any other way to solve this prob.
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hi Frnds,
I wanna to write a prog to check whether internet is
connected or not.
I tried using URL api or pinging Google
but in both the cases i was not satisfied with the
solution.
can anyone provide me any other way to solve this prob.
Why were you not satisfied with the solution?
You could try opening a file you know exists on the internet, that way if you can't open it, you know you aren't connected?
There are 2 things that need to work in order to have a "valid" internet connection:
Your side must be connected, and the server side must be connected. Opening up a webpage or a socket connection is the best way to verify that both sides work. In particular, you should try opening a socket/webpage that you want to connect to in the first place.