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":