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

Wrap socket so that it can be easily substituted for testing or for using other transport types (e.g. TCP)

Methods

close   new   recv   send  

Public Class methods

[Source]

# File lib/snmp/manager.rb, line 25
    def initialize
        @socket = UDPSocket.open
    end

Public Instance methods

[Source]

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

[Source]

# File lib/snmp/manager.rb, line 37
    def recv(max_bytes)
        @socket.recv(max_bytes)
    end

[Source]

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

[Validate]