[SNMP4J] how to SET?

Daniel Gyorfi gd425 at hszk.bme.hu
Mon Mar 19 19:00:32 CET 2007


Hi All!

I want to send a PDU with SET type.
I have a working method, which returns a perfect result for a single
GET type and I changed the type and added a value for the single
variablebinding:

            PDU request = new PDU();
            if (set){
                request.add(new VariableBinding(new OID(oid), new
OctetString(setValue)));
                request.setType(PDU.SET);
            } else{
                request.add(new VariableBinding(new OID(oid)));
                request.setType(pduType);
            }
            ResponseEvent responseEvent = snmp.send(request, target);

            PDU response = null;
            if (responseEvent != null) {
                response = responseEvent.getResponse();
            } else response = null;
            snmp.close();
            return response;

I didnt changed anything else, but Im not able to receive valid (not
null) response.
Do I have to change something also?
Am I missing something else?

Many thanks,
-- 
Daniel Gyorfi
xn--gyrfidniel-x4a35k



More information about the SNMP4J mailing list