[SNMP4J] Creation of Snmp and Target question

Frank Fock fock at agentpp.com
Thu Mar 17 18:38:47 CET 2005


Kevin,

Reusing the Target and Snmp instances is recommended. Creating a new Snmp
instance (including transport mappings) for each trap to sent would be a big
overhead.

Best regards,
Frank

Kevin J. Schmidt wrote:

>I'm writing an application using SNMP4J which will simply be sending
>notifications to one or more destinations. Is it alright to create the
>Snmp session and Target objects once (cache them, let's say) and then
>simply create a new PDU everytime I want to send a new trap (with new
>variable bindings, of course) using the cached Snmp and Target
>objects? Is there any problem with doing this or should a new Snmp
>session and Target be created each time a trap needs to be sent?
>
>Thanks,
>  
>





More information about the SNMP4J mailing list