class SNMP::UDPServerTransport
Public Class Methods
Source
# File lib/snmp/manager.rb, line 542 def initialize(host, port, address_family) @socket = UDPSocket.open(address_family) @socket.bind(host, port) end
Public Instance Methods
Source
# File lib/snmp/manager.rb, line 555 def recvfrom(max_bytes) data, host_info = @socket.recvfrom(max_bytes) _, host_port, _, host_ip = host_info return data, host_ip, host_port end
Source
# File lib/snmp/manager.rb, line 551 def send(data, host, port) @socket.send(data, 0, host, port) end