[SNMP4J] Determining the source of a timeout

Beede, Rodney D. rb at ou.edu
Wed Jan 2 16:38:56 CET 2008


I'm doing an asynchronous request to a machine that I know is not accepting SNMP requests.  As expected my ResponseListener.onResponse(...) method is being called with event.getResponse() being null indicating a timeout.

Unfortunately the event.getPeerAddress() is also returning null which makes it difficult for me to determine what host actually timed out.  My current work around is to use event.getUserObject() to pass the remote machine's IP address.

Does anybody know of another method that allows one to get the peer address when a timeout occurs on an asynchronous connection?  It would be nice of the snmp4j library still populated getPeerAddress() even when a timeout occurred so I wouldn't have to use my getUserObject on that.


Rodney Beede



More information about the SNMP4J mailing list