class SNMP4EM::Handler

Public Instance Methods

receive_data(data) click to toggle source
   # File lib/snmp4em/handler.rb
 3 def receive_data(data)
 4   begin
 5     message = SNMP::Message.decode(data)
 6   rescue Exception => err
 7     # the request that this malformed response corresponds to
 8     # will timeout and retry
 9     return
10   end
11   
12   response = message.pdu
13 
14   #
15   # in the event of a timeout retry, the request will have been
16   # pruned from the Manager, so the response is to an expired
17   # request, ignore it.
18   #
19 
20   if request = Manager.pending_requests[response.request_id]
21     request.handle_response(response)
22   end
23 end