1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-23 22:50:09 +03:00

F #3859: Monitor UDP use send with host and port (#4861)

This commit fix sending udp packets in HA environments, after leader
change
This commit is contained in:
Pavel Czerný 2020-06-02 10:18:54 +02:00 committed by GitHub
parent 71d004c778
commit 461c93f7f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,7 @@ class MonitorClient
MESSAGE_TYPES.each do |mt|
define_method("#{mt}_udp".downcase.to_sym) do |rc, payload|
msg = "#{mt} #{MESSAGE_STATUS[rc]} #{@hostid} #{pack(payload)}"
@socket_udp.send(msg, 0)
@socket_udp.send(msg, 0, @host, @port)
end
end
@ -67,7 +67,6 @@ class MonitorClient
@port = addr[1]
@socket_udp = UDPSocket.new(@family)
@socket_udp.connect(@host, @port)
@pubkey = @opts[:pubkey]