From 652c03430f36f9839547ee9317031ae8b0ec85b0 Mon Sep 17 00:00:00 2001 From: Vladislav P Date: Wed, 5 Oct 2022 21:38:13 +0300 Subject: [PATCH] Fix monitor spamming errors when dest UDP port is unreachable Use socket.send_to instead of socket.send Signed-off-by: Vladislav P --- src/algorithms/PVT/libs/monitor_ephemeris_udp_sink.cc | 6 ++---- src/algorithms/PVT/libs/monitor_pvt_udp_sink.cc | 3 +-- src/core/monitor/gnss_synchro_udp_sink.cc | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/algorithms/PVT/libs/monitor_ephemeris_udp_sink.cc b/src/algorithms/PVT/libs/monitor_ephemeris_udp_sink.cc index 8da16d190..ca4ac6fbd 100644 --- a/src/algorithms/PVT/libs/monitor_ephemeris_udp_sink.cc +++ b/src/algorithms/PVT/libs/monitor_ephemeris_udp_sink.cc @@ -58,11 +58,10 @@ bool Monitor_Ephemeris_Udp_Sink::write_galileo_ephemeris(const std::shared_ptr& for (const auto& endpoint : endpoints) { socket.open(endpoint.protocol(), error); - socket.connect(endpoint, error); try { - if (socket.send(boost::asio::buffer(outbound_data)) == 0) + if (socket.send_to(boost::asio::buffer(outbound_data), endpoint) == 0) { std::cerr << "Gnss_Synchro_Udp_Sink sent 0 bytes\n"; }