I'm using Snmp4j 2.2.3 and I am observing a lag of up to 8 seconds when I construct a org.snmp4j.Snmp
object via public Snmp(TransportMapping)
I wonder if anyone knows where in Snmp I should focus my attention. I see this happening on Redhat Linux, but I don't see the lag when running from a Windows XP box.
In the following code, line 3 "Snmp snmp = new Snmp(transport);" is freezing for up to 8 seconds.
Address targetAddress = new UdpAddress(host + "/" + port);
TransportMapping transport = new DefaultUdpTransportMapping();
Snmp snmp = new Snmp(transport);
CommunityTarget target = new CommunityTarget();
target.setCommunity(new OctetString("public"));
target.setAddress(targetAddress);
target.setRetries(2);
target.setTimeout(1500);
target.setVersion(SnmpConstants.version2c);
target.setMaxSizeRequestPDU(65535);
snmp.listen();
Thanks