Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.9.2
-
None
-
Moderate
Description
When using INFORMs instead of TRAPs the component must response to the Message. Otherwise the sender tries to send the same INFROM x-times and it will be processed x-times in the SNMP-Component.
The code below is taken from an example:
if ((pdu.getType() != PDU.TRAP) && (pdu.getType() != PDU.V1TRAP) && (pdu.getType() != PDU.REPORT) && (pdu.getType() != PDU.RESPONSE)) { pdu.setErrorIndex(0); pdu.setErrorStatus(0); pdu.setType(PDU.RESPONSE); StatusInformation statusInformation = new StatusInformation(); StateReference ref = e.getStateReference(); try { e.getMessageDispatcher().returnResponsePdu(e. getMessageProcessingModel(), e.getSecurityModel(), e.getSecurityName(), e.getSecurityLevel(), pdu, e.getMaxSizeResponsePDU(), ref, statusInformation); System.err.println("Response sent"); }catch (MessageException ex) { System.err.println("Error while sending response: "+ex.getMessage()); } } processPDU(pdu);
In this case the component sends a response to the sender before processing the message.