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

new(address_family) click to toggle source
# File lib/snmp/manager.rb, line 40
def initialize(address_family)
  @socket = UDPSocket.open(address_family)
end

Public Instance Methods

close() click to toggle source
# File lib/snmp/manager.rb, line 44
def close
  @socket.close
end
recv(max_bytes) click to toggle source
# File lib/snmp/manager.rb, line 52
def recv(max_bytes)
  @socket.recv(max_bytes)
end
send(data, host, port) click to toggle source
# File lib/snmp/manager.rb, line 48
def send(data, host, port)
  @socket.send(data, 0, host, port)
end