in reply to Re: threads and SNMP Session
in thread threads and SNMP Session

While searching on the internet I found many references to this solution yet no example that implements it or good documentation. If you know of any please post the links. Thank you

Replies are listed 'Best First'.
Re^3: threads and SNMP Session
by BrowserUk (Patriarch) on Dec 20, 2005 at 00:14 UTC

    If you are issuing identical requests to multiple hosts, you can just use SNMP::Multi and forget about the details :)

    If not, take a look at the source for SNMP::Multi, in particular the request() & execute() subs, to see what needs to be done. Basically, loop over the hosts issuing your get()s and passing a callback, (closures would be good here), and then enter the MainLoop and allow it to go to work.

    Of course, there's a bit more to it that that with timeouts, retries and collating the information returned.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.