Class SNMP::UDPServerTransport
In: lib/snmp/manager.rb
Parent: Object

Methods

close   new   recvfrom   send  

Public Class methods

[Source]

# File lib/snmp/manager.rb, line 498
    def initialize(host, port)
        @socket = UDPSocket.open
        @socket.bind(host, port)
    end

Public Instance methods

[Source]

# File lib/snmp/manager.rb, line 503
    def close
        @socket.close
    end

[Source]

# File lib/snmp/manager.rb, line 511
    def recvfrom(max_bytes)
        data, host_info = @socket.recvfrom(max_bytes)
        flags, host_port, host_name, host_ip = host_info
        return data, host_ip, host_port
    end

[Source]

# File lib/snmp/manager.rb, line 507
    def send(data, host, port)
        @socket.send(data, 0, host, port)
    end

[Validate]