[SNMP4J] Strange problem with multithreaded SNMPv3-Scan

chk-world at gmx.de chk-world at gmx.de
Mon Nov 8 18:40:06 CET 2004


Hi again,
ok, I tried the following to solve the problems described in my last post:
- Updating the library (now I'm using the latest 1.0.3c).

Using synchronous sending and a thread pool:
doing something like "response = snmp.sendPDU(request, uTarget);" in the run
method with a timeout of 1500 or more and retries of 3 or more in a Runnable
which is called via:
// -------------------------
for (int i = 1; i < 30; i++)
{
  pooledExecutor.execute(new RunnableSender("10.137.1." +
Integer.toString(i)));
  Thread.sleep(slowdown);
} // -------------------------
I was setting setAsyncMsgProcessingSupported to false. So every library
initialisation is done inside my RunnableSender.
If slowdown is bigger than 1000 everything works fine. If slowdown is less
than 1000 I get Timeouts from some agents (of course different agents on
different runs!).
How come? Is this library realy thread save in this case?

My second approache was to try asynchronouse sending:
for (int i = 1; i < 30; i++)
{
 configData.setSnmpBaseNetwork("10.137.27." + i);
 senderList.add(new SNMPv3Query(configData));
 Thread.sleep(slowdown);
}
I was setting setAsyncMsgProcessingSupported to true. And in SNMPv3Query
doing "snmp.sendPDU(request, uTarget, new Object(), this);".
Still there is the same odd behavior: If slowdown is bigger than 1000
everything works fine. If slowdown is less than 1000 I get Timeouts from
some agents (of course different agents on different runs!).
How come? Is this library realy thread save in this case?

If I say timeouts: In most cases the result is null.

Could someone please give me a hint? Or hase someone doen something like
this with this library?

Thanks,
Chris

-- 
Geschenkt: 3 Monate GMX ProMail + 3 Top-Spielfilme auf DVD
++ Jetzt kostenlos testen http://www.gmx.net/de/go/mail ++




More information about the SNMP4J mailing list