Class: SNMP::UDPTransport

Inherits:
Object show all
Defined in:
lib/openc3/io/openc3_snmp.rb

Instance Method Summary collapse

Instance Method Details

#recv(max_bytes) ⇒ Object



34
35
36
37
38
39
40
41
42
43
# File 'lib/openc3/io/openc3_snmp.rb', line 34

def recv(max_bytes)
  # Implement blocking using recvfrom_nonblock to prevent potential
  # ruby thread deadlock

  data, host_info = @socket.recvfrom_nonblock(max_bytes)
  return data
rescue Errno::EAGAIN, Errno::EWOULDBLOCK
  IO.fast_select([@socket])
  retry
end