我正在使用 Snmp4j 2.2.3,当我org.snmp4j.Snmp
通过构建对象时观察到长达 8 秒的延迟,public Snmp(TransportMapping)
我想知道是否有人知道我应该在 Snmp 中的哪个位置集中注意力。我在 Redhat Linux 上看到了这种情况,但是从 Windows XP 机器上运行时我看不到延迟。
在下面的代码中,第 3 行“Snmp snmp = new Snmp(transport);” 冻结长达 8 秒。
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();
谢谢