1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

regarind internet

Discussion in 'C' started by cnu_sree, Dec 11, 2006.

  1. cnu_sree

    cnu_sree New Member

    Joined:
    Dec 11, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    how we can find whether net is enabled or disabled using c.
    iam doing the coding in unix.
    i tried using this:
    if(system("ping -c 1 -w 1 yahoo.com > /dev/null 2> /dev/null") != 0)
    fprintf(stderr,"Net is down!\n");
    else
    fprintf(stderr,"Net is up\n");

    but i want to do this without using ping to websites.
    so someone suggested be ping ur own gateway or use raw sockets
    no knowledge on that.
    so please tell me how we can do this
    thank u
    inadvance
    sreee
     

Share This Page