Faster way to check if there is internet connection in C?
Hi,
I would like to check before doing some networking/backup stuffs that internet is available. (c pure programming lang. (not in c++)) I could find some solution but arent adapted to Linux so much. http://stackoverflow.com/questions/8...net-connection Would you know the best way? for instance, in bash, i use : Code:
curl --silent --head http://www.google.com/ |egrep Found I would that it works as well under ms windows. regards |
Something like this? http://en.wikibooks.org/wiki/C_Progr...orking_in_UNIX
The Beej's guide is also often cited as C network programming reference http://beej.us/guide/bgnet/ |
Quote:
netinet is not into pdcurses.dll Code:
#include <arpa/inet.h> I will try under windows... and let you know. lets cross fingers |
Quote:
Code:
#ifdef WIN32 // works for 32- and 64-bit Visual Studio |
Quote:
hopefully we can do it without winock windoze and io stuffs :) lets ... see. we keep in touch since we have same concern: portability I have made several functions that work for both platfomr: nix and win. we can chat |
Quote:
|
All times are GMT -5. The time now is 01:33 PM. |