[SNMP4J] problem to getnext

abdel boutz1 at caramail.com
Fri Apr 1 11:34:18 CEST 2005


Hello I don't have an algorithm which allows me to stop with the requete getNext could you help me please.
this is my code:
 PDU pdu = new PDU();
 variablebinding vbs.setOid(new OID("1.3.6.1.2.1.1.1")); 

            do
            {
               pdu.add(vbs);
               pdu.setType(PDU.GETNEXT);
               response = protocol.send(pdu, target);
               if(response.getResponse() == null)
               {
                  System.out.println("Wait for response");
               }
               System.out.println("recu de message from :" + response.getPeerAddress()+'\n');
               pdu=response.getResponse();
               vbs=pdu.get(0);
               System.out.println("OID = " + vbs.getOid()+ " et value =  " + vbs.getVariable()); //here it posts the following value each time 
              System.out.println(response.getResponse().toString());
           }
           while(true); // it is here that it is necessary to post the algorithm for stopped

Sorry for my english.
thank's 


More information about the SNMP4J mailing list