Skip to content

Commit 7861b17

Browse files
committed
Use write() to fix SNMP on osx/freebsd.
1 parent 0380c5e commit 7861b17

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/snmp/manager.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ def send(data, host, port, flags = 0)
6262
@socket.sendto(data, host, port, flags)
6363
rescue NoMethodError
6464
@socket.send(data, 0, host, port)
65+
rescue ::Errno::EISCONN
66+
@socket.write(data)
6567
end
66-
6768
end
6869

6970
def recv(max_bytes)

0 commit comments

Comments
 (0)