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.
Printable View
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.