CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Threaded View

  1. #7
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: Trying to establish if Internet connection is available from a service

    it's not just InternetGetConnectedState() that doesn't work from a service. it's the entire suite of WinINET functions that don't work reliably from a service.

    This leaves either WinHttp or sockets to do any internet stuff from a service. And this poses some extra problems.

    When you use WinINET, you are effectively using the IE settings for accessing the internet. Security, firewall, proxy, etc.

    If you use WinHttp and/or sockets, you will need to do some extra work making your own internet settings dialog and allowing for all the things that make accessing the internet nasty bussiness (firewalls/proxy servers etc).


    If you are using winhttp and/or sockets from a service however... don't bother with trying to check if a connection is up. There's no such thing as the "dialer" in a service, you ether have access or you don't. just make a connection to the server. If it fails, you have no internet, or the server isn't running, or one of the other internet issues...


    the whole reason for the existance of InternetGetConnectedState() is to check if the internet is available WITHOUT triggering the dialer (which would happen with a straightforward connect call if set to autodial).
    THe good news of course... use of the dialer is dropping fast, permanent internet via cable/dsl is fast becoming the norm.
    Last edited by OReubens; July 7th, 2012 at 11:58 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured