Hello,
I am trying the understand the correct context for possible using new Snmp() + listen()
.
For v1/v2 we just use this:
Snmp snmp = new Snmp(new DefaultUdpTransportMapping());
snmp.listen();
Then for every CommunityTarget we can trigger needed requests, and looks like in that scenario one Snmp object can lead communication with group of devices.
But if we move to v3, valid UserTarget is not enough cause Snmp initialize step wants more:
Snmp snmp = new Snmp(new DefaultUdpTransportMapping());
snmp.getUSM().addUser(usmUser);
snmp.listen();
In other words, looks like if we will use one Snmp for different devices (at least v3) we somehow mixed their credential/security level under that one object.
So, a pair of question to you please related to text above:
- Is it correct to create one Snmp object for every new device and then use that object to request same device (GET/WALK/OTHER) many times?
- Due to new Snmp object opens new socket (hard operation) can we somehow improve the using of Snmp object to process different devices under v1/v2/v3 at the same time?
If my understanding is wrong, please light my mistakes.
Regards.