Re: Is there any API to check if a machine is network connection?

From: Ben Rush (kwendex_at_yahoo.com)
Date: 06/20/04

  • Next message: anonymous_at_discussions.microsoft.com: "error in explorer 6.1 for 98 se"
    Date: 19 Jun 2004 23:34:39 -0700
    
    

    Possibly a bit off topic, but here goes...

    What about proxying? One of the functions, InternetCheckConnection,
    requires a URL with which to check the connection against - presumably
    by doing some kind of ping (i'm not sure about this).

    However, if the network is active but one cannot reach a particular
    resource due to proxying, potentially, wouldn't this function fail,
    thereby returning FALSE? I don't see this function requiring any
    HINTERNET handles - so if you setup proxying in your InternetX
    functions, but checked for a "hot" connection w/ this function, you
    might get back a bad status even if the network could be accessible
    through your attained proxy configurations.

    InternetGetConnectedState also appears to have issues with Windows ME
    (in my personal experience). And if it returns TRUE, this doesn't
    absolutely mean that the network is reachable, just that the
    connectoid is active.

    It appears as though no single function really can be used to
    absolutely determine if some particular resource can be attained. The
    only way to know for sure is to actually attempt to attain it.

    "Kevin" <kevinlouisnospam@hotmail.com> wrote in message news:<eUhaN6yUEHA.4048@TK2MSFTNGP12.phx.gbl>...
    > Thanks. I find one more:
    >
    > InternetQueryOption with the INTERNET_OPTION_CONNECTED_STATE.
    >
    > e.g.
    > InternetQueryOption(NULL,
    > INTERNET_OPTION_CONNECTED_STATE, &dwState, &dwSize)
    > && (dwState & INTERNET_STATE_CONNECTED);
    >
    >
    > "Igor Tandetnik" <itandetnik@mvps.org> wrote in message
    > news:eYkgAnuUEHA.2972@TK2MSFTNGP12.phx.gbl...
    > > "Kevin" <kevinlouisnospam@hotmail.com> wrote in message
    > > news:eI2y4dnUEHA.3944@TK2MSFTNGP12.phx.gbl
    > > > I want to load a cached web page if a machine has no network
    > > > connection. Could you tell me how I can check if the machine is
    > > > connected? I may use ping, but I am not sure how it is coded.
    > >
    > > InternetGetConnectedState, InternetCheckConnection, IsNetworkAlive
    > > --
    > > With best wishes,
    > > Igor Tandetnik
    > >
    > > "For every complex problem, there is a solution that is simple, neat,
    > > and wrong." H.L. Mencken
    > >
    > >


  • Next message: anonymous_at_discussions.microsoft.com: "error in explorer 6.1 for 98 se"