How can I programmatically check whether my machine has internet access or not using C/C++, is it just a matter of pinging an IP? How does NIC do it ? I mean something like
There is actually a very smart way including code snip here.
It basically using the cmd option: While in CMD hit: route print
.
This will map routing table with an array and will look for 0.0.0.0 as an available internet connection.
I used it with a while(true){//the code in here } //check for inet connection , else will sleep for 10 mins and check again