Checking for internet connection

This is a discussion on Checking for internet connection within the C Programming forums, part of the General Programming Boards category; How can i test if the machine is connected to the internet, without windows prompting the user for a connection? ...

  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    21

    Angry Checking for internet connection

    How can i test if the machine is connected to the internet, without windows prompting the user for a connection?

    starting winsock and trying to connect to some website at port 80 or something similar will prompt.

    I know there's some method to check for active RAS connections, is there a more general method??

    thanks in advance,
    ROCKaMIC

  2. #2
    Registered User Azuth's Avatar
    Join Date
    Feb 2002
    Posts
    236
    A few things to note:

    - This thread should probably be under the Network / Device communication section.

    - I assume from what you've said that you're only interested in a Windows answer, but you should be explicit about that.

    - Are you only talking about a dial up connection to the Internet? A person could be connected through a gateway on their local network or via some other connection form. Those people would never see a prompt to dial a connection.

    - People may be a little unwilling to help unless you explain what it's for. Asking people to help you write code that does things across the Internet while avoiding user intervention could appear to be a bit dodgy.
    Demonographic rhinology is not the only possible outcome, but why take the chance

  3. #3
    Jez
    Jez is offline
    The C-er
    Join Date
    Mar 2004
    Posts
    192
    - People may be a little unwilling to help unless you explain what it's for. Asking people to help you write code that does things across the Internet while avoiding user intervention could appear to be a bit dodgy.
    My own sentiments entirely.

  4. #4
    Registered User
    Join Date
    Oct 2003
    Posts
    21
    Yes it is for windows.

    No, i'm more interested in a general internet test, not just for RAS.

    It's for an auto-update module, if not connected it will not go on and that's it. because that would mean quitting full screen mode..

    anyways.. some help please??

    i found InternetGetConnectedState().. is there anything else (reliable)??

    thanks again,
    ROCKaMIC

  5. #5
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544

  6. #6
    Registered User
    Join Date
    Sep 2004
    Posts
    123
    It's for an auto-update module, if not connected it will not go on and that's it. because that would mean quitting full screen mode..
    Even so, there ought to be some user interaction before just going ahead and carrying out an update. Some people get a bit upset when they discover programs exploiting an open Internet connection to perform autoupdates - how do they know that the autoupdate won't insidiously download a spyware component?

    Believe me, this is big in the antispyware community - I've seen programs targeted by such products as Ad-Aware, Spyware Blaster, and Spybot Search and Destroy for such practices.

    If the user is on dial-up, and suddenly something connects to the open Internet connection without telling the user, they may find that their connection speed suddenly decreases for no immediately obvious reason.

    By all means test for the presence of an open connection: I'm just adding that you ought to let the user know beforehand or at least make your autoupdate a user-configurable option.

  7. #7
    Registered User
    Join Date
    Oct 2003
    Posts
    21

    Thumbs up

    Quote Originally Posted by Angoid
    Even so, there ought to be some user interaction before just going ahead and carrying out an update. Some people get a bit upset when they discover programs exploiting an open Internet connection to perform autoupdates - how do they know that the autoupdate won't insidiously download a spyware component?

    Believe me, this is big in the antispyware community - I've seen programs targeted by such products as Ad-Aware, Spyware Blaster, and Spybot Search and Destroy for such practices.

    If the user is on dial-up, and suddenly something connects to the open Internet connection without telling the user, they may find that their connection speed suddenly decreases for no immediately obvious reason.

    By all means test for the presence of an open connection: I'm just adding that you ought to let the user know beforehand or at least make your autoupdate a user-configurable option.
    Yes, there's a prompt inside the program that will only appear if the user is connected. i know.. it would freak me out if a program connected to the internet without prompting, gotta love firewalls lol.
    Nice comment!

    Thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 09:38 AM
  2. Problems about gcc installation
    By kevin_cat in forum Linux Programming
    Replies: 4
    Last Post: 08-09-2005, 09:05 AM
  3. Checking for internet connection
    By ROCKaMIC in forum Networking/Device Communication
    Replies: 2
    Last Post: 11-13-2004, 08:08 AM
  4. Headers that use each other
    By nickname_changed in forum C++ Programming
    Replies: 7
    Last Post: 10-03-2003, 04:25 AM
  5. checking for an internet connection
    By canine in forum C Programming
    Replies: 6
    Last Post: 10-26-2001, 07:33 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21