[SNMP4J] Sending traps and receiving/responding to requests...

Bruno Tessier btessier at nakinasystems.com
Wed Apr 5 23:03:26 CEST 2006


Hi,

This is similar to another topic posted in March, but in this case the
roles are reversed.  While the other topic was about receiving traps and
sending requests using the same Snmp (snmp4j class) instance (i.e.
creating a manager), mine is about sending traps and receiving requests
using the same Snmp instance (i.e. creating an agent).  I read through
the answer of the other topic I'm talking about (title: [SNMP4J] Writinf
SNMP Manager using SNMP4J), and I doubt it would help in my case.

I would like to do both things (send traps and receive requests) in the
same class, using the same Snmp instance, is is possible?  

Right now, my class extends Thread and implements CommandResponder, and
when I initialize the Transport object and the Snmp object, at one point
I call the listen() method of Transport, and right after that, when I'm
ready to have my class wait for incoming requests, I call "this.wait()".
I can get the incoming requests and process them OK, but the problem is
while my class is waiting for these requests to come in, I'm trying to
trigger it to send a trap, and that is not working.

I don't know, maybe I should be using CommandProcessor instead of
CommandResponder, but there not a lot of documentation about this class
and its methods.  Any help/examples available?

Thanks,
Bruno





More information about the SNMP4J mailing list