[SNMP4J] Need help with Snmp4j CommandResponder
Frank Fock
fock at agentpp.com
Tue Jun 20 07:49:54 CEST 2006
Hi Srinivas,
You need to call "snmp.listen()" instead of
"transport.listen()". That's all.
Best regards,
Frank
Y Srinivas wrote:
> Hi Frank,
>
> I have problem listening to responses and to read responses i
> have used the following lines of code but i don't see that the
> program is catching any responses as i am able to do with a snmp
> tracer.
>
> class MySnmp1 implements CommandResponder{
> TransportMapping transport;
> Snmp snmp;
> public MySnmp1(){
> try{
> transport = new DefaultUdpTransportMapping(new
> UdpAddress("192.168.4.58/888"));
> snmp = new Snmp(transport);
> snmp.addCommandResponder(this);
> System.out.println("transportBinding..");
> transport.listen();
> }catch(Exception e){e.printStackTrace();}
> }
> public synchronized void processPdu(CommandResponderEvent e) {
> System.out.println("----Received Response -----");
> }
> public static void main(String[] args) throws Exception
> {
> new MySnmp1();
> while(true){}
> }
> }
>
> regards,
> Srinivas
>
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j
--
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com
More information about the SNMP4J
mailing list