mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 07:13:03 +00:00 
			
		
		
		
	Fix monitor spamming errors when dest UDP port is unreachable
Use socket.send_to instead of socket.send Signed-off-by: Vladislav P <vladisslav2011@gmail.com>
This commit is contained in:
		| @@ -58,11 +58,10 @@ bool Monitor_Ephemeris_Udp_Sink::write_galileo_ephemeris(const std::shared_ptr<G | ||||
|     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) | ||||
|                         { | ||||
|                             return false; | ||||
|                         } | ||||
| @@ -95,11 +94,10 @@ bool Monitor_Ephemeris_Udp_Sink::write_gps_ephemeris(const std::shared_ptr<Gps_E | ||||
|     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) | ||||
|                         { | ||||
|                             return false; | ||||
|                         } | ||||
|   | ||||
| @@ -57,11 +57,10 @@ bool Monitor_Pvt_Udp_Sink::write_monitor_pvt(const Monitor_Pvt* const monitor_pv | ||||
|     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) | ||||
|                         { | ||||
|                             return false; | ||||
|                         } | ||||
|   | ||||
| @@ -56,11 +56,10 @@ bool Gnss_Synchro_Udp_Sink::write_gnss_synchro(const std::vector<Gnss_Synchro>& | ||||
|     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"; | ||||
|                         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Vladislav P
					Vladislav P