[SNMP4J] aync send thread?

Frank Fock fock at agentpp.com
Mon Sep 25 23:48:29 CEST 2006


Please find my comments below:

Scott MacKay wrote:
> Cool, good to know.  With that in mind, I wanted to
> check on a particular setup.  It does not say it
> cannot be done in the javadoc, just wanted
> verification.
> 
> i have a class with variables for a PDU, a Target, and
> implementation of ReponseListener, along with a
> variable to store an OID value,
> 
> I have an array of this class, each set up with its
> own PDU and target.
> In a loop, I want to async send the requests.  They
> all are v2 and I have 1 Snmp object in the thread
> which will handle the dispatching.
> 
OK.

> Can I loop thru and send each class's PDU, target, and
> object as the ResponseListener with a single Snmp
> object?
> 

Yes, that's the recommended approach.

> I recall in a previous email something about needing
> to clone involving request id.  If I loop on the sends
> every 30 seconds, allowing a timeout of 3 seconds, is
> resetting/cloning of the requestid required?  Each

No, if the PDU instance is not send again, before
all previous requests have timed out.

> time thru the loop, can I just reset the id to 0?
> 
Yes, then it is ok to simply reset the request ID.
Otherwise, cloning the request ID or the whole PDU
would be required to avoid concurrent modification of
request ID.

Best regards,
Frank

> Thanks in advance!
> 
> -Scott
> 
> 
> --- Frank Fock <fock at agentpp.com> wrote:
> 
>> Hi Scott,
>>
>> In SNMP4J there is no thread creation per SNMP
>> request.
>> Instead each transport mapping has its own thread
>> and
>> each Snmp instance has its own thread.
>>
>> Best regards,
>> Frank
>>
>> Scott MacKay wrote:
>>> Out of curiosity, when you perform a snmp send
>> request
>>> asynchronously with a listener, does it generate a
>>> thread to perform the call?
>>>
>>> If so, can someone detail how you use ThreadPools
>> to
>>> limit the total number of snmp calls that can be
>>> simultaneously running?
>>>
>>> Thanks!
>>>
>>> -Scott
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the SNMP4J mailing list