[SNMP4J] problem to getnext

Frank Fock fock at agentpp.com
Fri Apr 1 18:53:06 CEST 2005


Hello,

If I understand your question correct, then you are looking for
WALK algorithm, right? You can find one in the SnmpRequest.java
example which is the base for the console example.

Best regards,
Frank

In any case it would be better to change "while(true)" into "while(false)"
to save CPU cycles ;-)

abdel wrote:

>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 
>_______________________________________________
>SNMP4J mailing list
>SNMP4J at agentpp.org
>http://lists.agentpp.org/mailman/listinfo/snmp4j
>
>  
>





More information about the SNMP4J mailing list