class SNMP::UDPTransport
Wrap socket so that it can be easily substituted for testing or for using other transport types (e.g. TCP)
Public Class Methods
Source
# File lib/snmp/manager.rb, line 41 def initialize(address_family) @socket = UDPSocket.open(address_family) end
Public Instance Methods
Source
# File lib/snmp/manager.rb, line 53 def recv(max_bytes) @socket.recv(max_bytes) end
Source
# File lib/snmp/manager.rb, line 49 def send(data, host, port) @socket.send(data, 0, host, port) end