Results 1 to 12 of 12

Thread: [RESOLVED] Pinging - Network Availability - ping-then-do

  1. #1

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,754

    Resolved [RESOLVED] Pinging - Network Availability - ping-then-do

    As you may or may not know I think pinging "something" to determine whether or not to do something is wrong. An example would be ping a mail server, if the ping is good then send the mail. At best it is naive. If you want to discuss it or have an example of when it is better, I'll be glad to.

    So yesterday I was involved in another debate and this morning I got up and put together some code that addresses this issue. The code, with sample app can be found here. It runs on XP, and later today I will test with Windows 7.

    http://www.vbforums.com/showthread.php?t=608575

    What the app does is attempt to find where you meet the internet. When you ping some far distant host, say www.yahoo.com, and get successful replies the internet is up. When unsuccessful is it yahoo, your ISP, or some other ISP along the route.

    More importantly do you care if it is beyond your ISP? You can't do anything about it. I think what most of us really want is to know that we can get to our ISP.

    So that is what the app does. It basically does a traceroute until it finds the edge, where you meet the internet. From then on it only pings to that address.

    So give it a try, let me know what you think.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  2. #2

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,754

    Re: Pinging - Network Availability - ping-then-do

    I should have mentioned this in my first post.

    1 - start the application

    2 - repair your network connection if you have a DHCP assigned address, or disable / enable your network interface.

    You should see several transitions in the app.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  3. #3

  4. #4

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,754

    Re: Pinging - Network Availability - ping-then-do

    Installed and ran OK on Windows 7, except that every app of mine (XP VB2008 Express) that I install shows a message when I double click the SetUp icon.

    The message is something to the effect that the application didn't appear to install correctly... But it happens before I click the Install button??? I just close the warning, click Install, and all is well. This the second app that did that.

    I took what I posted and put it in another application like this:

    MyMonitor = New MonitorNetworkResource(, True) 'monitor path to internet

    then in a timer I did this

    If MyMonitor.isUp Then Label11.Text = "UP" Else Label11.Text = "DOWN"

    and went on with my business. About an hour later I noticed that the label said down, and I'll be danged, it was.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  5. #5

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,754

    Re: Pinging - Network Availability - ping-then-do

    Just updated the code. It now determines the PC's IP address based on the GateWay used to access the internet, so it should work with PC's with more than one adapter, but I have no way of testing.

    You can click on the Ban Ping-Then-Do in my signature to get the thread with the latest code.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  6. #6

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,754

    Re: Pinging - Network Availability - ping-then-do

    Quote Originally Posted by dbasnett View Post
    Installed and ran OK on Windows 7, except that every app of mine (XP VB2008 Express) that I install shows a message when I double click the SetUp icon.

    The message is something to the effect that the application didn't appear to install correctly... But it happens before I click the Install button??? I just close the warning, click Install, and all is well. This the second app that did that.

    I took what I posted and put it in another application like this:

    MyMonitor = New MonitorNetworkResource(, True) 'monitor path to internet

    then in a timer I did this

    If MyMonitor.isUp Then Label11.Text = "UP" Else Label11.Text = "DOWN"

    and went on with my business. About an hour later I noticed that the label said down, and I'll be danged, it was.
    My problem with Windows 7 install was resolved by installing by double clicking MyAppName.application instead of Setup.exe.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  7. #7

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,754

    Re: Pinging - Network Availability - ping-then-do

    FYI

    My ISP uses radios (long haul WIFI) to service us rural people. Sometimes the service is spotty. I ran the sample application last night and it detected 81 outages and did so without sending pings across the internet backbone.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  8. #8

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,754

    Re: Pinging - Network Availability - ping-then-do

    There are now three versions of how to do this. You can read all about it by following the Ban Ping-Then-Do link in my signature. One of the samples is just a simple internet up / down program. Here is the screen shot of the complex example



    To all of those that helped / are helping, thanks!
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  9. #9
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,828

    Re: [RESOLVED] Pinging - Network Availability - ping-then-do

    Shouldn't this be a CodeBank entry?
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  10. #10

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,754

    Re: [RESOLVED] Pinging - Network Availability - ping-then-do

    That is why I resolved this and added the link in my signature. Click it and see where you go.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  11. #11
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,828

    Re: [RESOLVED] Pinging - Network Availability - ping-then-do

    But it was never a question to begin with -_-
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  12. #12

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,754

    Re: [RESOLVED] Pinging - Network Availability - ping-then-do

    Well I have resolved the thread and the content is where it should be. If this threads presence here offends you, report me and ask the mods to remove the thread.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

Tags for this Thread

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