Class: SNMP::UDPTransport

### Home Classes Methods

### In Files

- lib/snmp/manager.rb

### Parent

Object

### Methods

- ::new
- #close
- #recv
- #send

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- SNMP
- SNMP::BER
- SNMP::Counter32
- SNMP::Counter64
- SNMP::EndOfMibView
- SNMP::Gauge32
- SNMP::GetBulkRequest
- SNMP::GetNextRequest
- SNMP::GetRequest
- SNMP::InformRequest
- SNMP::Integer
- SNMP::Integer32
- SNMP::InvalidErrorStatus
- SNMP::InvalidGenericTrap
- SNMP::InvalidIpAddress
- SNMP::InvalidPduTag
- SNMP::InvalidTrapVarbind
- SNMP::IpAddress
- SNMP::MIB
- SNMP::MIB::ModuleNotLoadedError
- SNMP::Manager
- SNMP::Manager::Config
- SNMP::Message
- SNMP::NoSuchInstance
- SNMP::NoSuchObject
- SNMP::Null
- SNMP::ObjectId
- SNMP::ObjectName
- SNMP::OctetString
- SNMP::Opaque
- SNMP::PDU
- SNMP::ParseError
- SNMP::RequestId
- SNMP::RequestTimeout
- SNMP::Response
- SNMP::SNMPv1_Trap
- SNMP::SNMPv2_Trap
- SNMP::SetRequest
- SNMP::TimeTicks
- SNMP::TrapListener
- SNMP::TrapListener::Config
- SNMP::UDPServerTransport
- SNMP::UDPTransport
- SNMP::Unsigned32
- SNMP::UnsignedInteger
- SNMP::UnsupportedPduTag
- SNMP::UnsupportedValueTag
- SNMP::UnsupportedVersion
- SNMP::VarBind
- SNMP::VarBindList
- Fixnum
- Object

No matching classes.

# 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 27
    def initialize(address_family)
      @socket = UDPSocket.open(address_family)
    end

### Public Instance Methods

close() click to toggle source

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

recv(max_bytes) click to toggle source

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

send(data, host, port) click to toggle source

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.