Async? Cancel helps.

 // sending request
   ResponseListener listener = new ResponseListener() {
     public void onResponse(ResponseEvent event) {
       // Always cancel async request when response has been received
       // otherwise a memory leak is created! Not canceling a request
       // immediately can be useful when sending a request to a broadcast
       // address.
       ((Snmp)event.getSource()).cancel(event.getRequest(), this);
       System.out.println("Received response PDU is: "+event.getResponse());
     }
   };

On Mon, Jul 23, 2012 at 4:46 PM, Prema Upot <[email protected]> wrote:
> Hi,
>
> We see timeouts in snmp4j intermittently for snmp get requests even though 
> the response is received well within the timeout period. When debug is turned 
> on, I see messages like "Received response that cannot be matched to any 
> outstanding request, address...". The timeout set is 8 seconds and the actual 
> response is received within a few milliseconds (as seen in snmp4j logs). The 
> snmp4j version is 1.11. Has anyone seen this problem ?
>
> Thanks,
>
> _______________________________________________
> SNMP4J mailing list
> [email protected]
> http://lists.agentpp.org/mailman/listinfo/snmp4j
_______________________________________________
SNMP4J mailing list
[email protected]
http://lists.agentpp.org/mailman/listinfo/snmp4j

Reply via email to