This sounds like a problem with lots of potential solutions.

The approach I was thinking about depends on how you need to test each individual AP. You say it's via telnet, and (in a follow up posting) that you want to increase the timeout to avoid false positive, so maybe the algorithm looks like this:

  1. Open socket
  2. Connect (TCP) to telnet port on AP
  3. Send "Are you OK" message
  4. Wait for long enough for healthy AP to respond
  5. Read from socket
  6. Work out from reply whether AP is OK or not
  7. Close socket
If this is the algorithm for each AP, then this can be scaled up either by creating threads (or processes) which can all follow the same sequence (as described above) or alternatively just process an array of APs in parallel:

  1. Open 10 sockets
  2. Connect to 10 APs
  3. Send 10 messages
  4. Wait Once
  5. ...
Maybe this approach isn't suitable for you (maybe your AP testing is too wrapped up in a module/DLL) but it might be suitable for someone else with a generally similar problem who stumbles accross these posts in future.

--
use JAPH;
print JAPH::asString();


In reply to Re: Testing many devices - are threads the answer? by wol
in thread Testing many devices - are threads the answer? by McDarren

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.