locked
ping addresses in listview at different times? RRS feed

  • Question

  • I have a listview with three columns adress: , status and interval

    now, I would like to ping each adress and display its status at different intervals!

    Is it possible to do that or I have to PING each row with one timer?
    Wednesday, January 4, 2012 10:44 PM

Answers

  • Frank L. Smith, as I understand you PING each row from the top to the end of the listview with one timer - lets say every 5 seconds one row.

    What I realy want is PING each row ( adress ) at te specified interval - see below.

    Listview:

    Adress        Status       Interval

    google          OK             500ms

    microsoft       OK             3000ms

    ....

     


    Ah I missed that in your first post - I see now that you want different times for each.

    First, before continuing, what you're showing as example times isn't realistic for a number of reasons - including the most obvious one: The ping itself will take longer than the cycle time. What's more though, that's all this thing would do - it would be difficult to do anything other than just "look" and even hope that the display updates.

    It's not any of my business why you'd want it to ping on this schedule, but if you were to extend it to several minutes between each one, then one thought would be to have a single timer and then increment variables so that if one is equal to a setting, you ping that one and set that variable back to zero (like a typical asynch timer would work -- it just repeats every xx time value).

    Maybe not as long as minutes between each call but certainly not as quickly as a half second.

    Fodder for thought. Good luck on your project. :)

    • Proposed as answer by Mike Feng Friday, January 6, 2012 11:33 AM
    • Marked as answer by MatjazB Friday, January 6, 2012 12:20 PM
    Thursday, January 5, 2012 7:07 PM

All replies

  • I have a listview with three columns adress: , status and interval

    now, I would like to ping each adress and display its status at different intervals!

    Is it possible to do that or I have to PING each row with one timer?


    You might consider using a single timer along with a class-level variable (integer).

    In the timer's tick event, increment that class-level variable then use a Select Case/End Case to determine which one to ping ("round robin").

    Obviously you'll also need to reset the class-level variable back to zero after the last item in the listview has been checked.



    EDIT

    One part of what I just said needs improvement: Select Case is a bad idea as that would lock you into having to know how many items there are in the ListView.

    Instead, simply address the URL to ping from the ListView based on the index being equal to the class-level variable.

    Make sense?

    • Edited by Frank L. Smith Wednesday, January 4, 2012 10:55 PM ...dumb idea
    Wednesday, January 4, 2012 10:51 PM
  • Frank L. Smith, as I understand you PING each row from the top to the end of the listview with one timer - lets say every 5 seconds one row.

    What I realy want is PING each row ( adress ) at te specified interval - see below.

    Listview:

    Adress        Status       Interval

    google          OK             500ms

    microsoft       OK             3000ms

    ....

     

    Thursday, January 5, 2012 6:43 AM
  • Frank L. Smith, as I understand you PING each row from the top to the end of the listview with one timer - lets say every 5 seconds one row.

    What I realy want is PING each row ( adress ) at te specified interval - see below.

    Listview:

    Adress        Status       Interval

    google          OK             500ms

    microsoft       OK             3000ms

    ....

     


    Ah I missed that in your first post - I see now that you want different times for each.

    First, before continuing, what you're showing as example times isn't realistic for a number of reasons - including the most obvious one: The ping itself will take longer than the cycle time. What's more though, that's all this thing would do - it would be difficult to do anything other than just "look" and even hope that the display updates.

    It's not any of my business why you'd want it to ping on this schedule, but if you were to extend it to several minutes between each one, then one thought would be to have a single timer and then increment variables so that if one is equal to a setting, you ping that one and set that variable back to zero (like a typical asynch timer would work -- it just repeats every xx time value).

    Maybe not as long as minutes between each call but certainly not as quickly as a half second.

    Fodder for thought. Good luck on your project. :)

    • Proposed as answer by Mike Feng Friday, January 6, 2012 11:33 AM
    • Marked as answer by MatjazB Friday, January 6, 2012 12:20 PM
    Thursday, January 5, 2012 7:07 PM
  • Well 500ms is a hard one :D

    I will try with a asynch. timer but with longer times.

    Again thank you.

    Friday, January 6, 2012 12:24 PM