Looking for a connection monitor that tells you if your internet died

Discussion in 'Networking and Security' started by Daal, Jan 21, 2011.

  1. #11     Jan 21, 2011
  2. #12     Jan 23, 2011
  3. If you download either vb.net express or c#express, it takes about 10 seconds to do that.

    Any winform application has infact , within the application events, built in, disconnect/reconnect event handler which is called on these events. There you can put simple code to do anything you like.

    Tom
     
    #13     Jan 24, 2011
  4. LeeD

    LeeD

    Except I understand it tracks LAN (or USB modem) connection. If you have a modem-router, there is no way the PC will know the cable from the modem-router to the the telephone exchange got cut... unless the PC constantly sends some requests that require such a connection.
     
    #14     Jan 24, 2011
  5. hmmm, i am not sure what you mean. It seems to me that it correctly monitors any internet disconnection, reconnection...

    You find it in: Application Properties > Wiew Application Events

    Event: NetworkAvailabilityChanged
    Property: e.IsNetworkAvailable

    Tom
     
    #15     Jan 24, 2011
  6. I have done extensive network redundancy testing for our colocation environment. This included Windows 7 and Windows 2008. For both of these environments, the NetworkAvailabilityChanged event will fire on a failure in the cable or first switch. Failure of any switch or connection passed this point do not fire the NetworkAvailabilityChanged event. I have only ever seen Windows realize that there was a problem upstream if there was an actual TCP session running/opening. There is multi-gateway logic in Windows 2008 (7 as well I think), but the failover logic depends upon failed TCP connections. We had to use ICMP-ping packets and custom logic.
     
    #16     Jan 24, 2011
  7. Thanks, that is good to know. I guess that for the use the OP intended it could be fine. Or else, there are other instruments within the language which can be useful. For instance:

    My.Computer.Network.Ping() and many others ...

    I guess for more complex checks one could create create a simple monitor which fired every whatever interval ... it's a just a very few lines of code.

    Tom
     
    #17     Jan 24, 2011
  8. Daal

    Daal

    I'm using the cmd ping utility from windows, its not capturing the internet fluctuation that was the problem, guess my internet never died, it just fluctuates like crazy. The main problem is me missing hands from the pokerstars client when my internet goes idle for a while.

    I'm buying a good wireless antenna and will use that instead of the built-in one
     
    #18     Jan 24, 2011
  9. LeeD

    LeeD

    wireless is not super-stable by design. a neighbour switches on a microwave and you may loose connection for fraction of a second. have you tried ethernet cable instead?
     
    #19     Jan 24, 2011
  10. that's another matter. Consider changing provider ;-))

    Anyway in theme of checks, whenever ping might not work (it might), i have seen recommending on the web also these approaches:

    {
    System.Net.IPHostEntry objIPHE = System.Net.Dns.GetHostEntry("www.google.com");
    }
    catch
    {
    MessageBox.Show ("...No Conn...");
    }



    bool ConnectionExists()
    {
    try
    {
    System.Net.Sockets.TcpClient clnt=new System.Net.Sockets.TcpClient("www.google.com",80);
    clnt.Close();
    return true;
    }
    catch(System.Exception ex)
    {
    return false;
    }
    }


    might give them a try ... let us know in case ...


    Tom
     
    #20     Jan 24, 2011