mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-31 03:14:56 +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:
parent
4f2d73dfe3
commit
652c03430f
@ -58,11 +58,10 @@ bool Monitor_Ephemeris_Udp_Sink::write_galileo_ephemeris(const std::shared_ptr<G
|
|||||||
for (const auto& endpoint : endpoints)
|
for (const auto& endpoint : endpoints)
|
||||||
{
|
{
|
||||||
socket.open(endpoint.protocol(), error);
|
socket.open(endpoint.protocol(), error);
|
||||||
socket.connect(endpoint, error);
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (socket.send(boost::asio::buffer(outbound_data)) == 0)
|
if (socket.send_to(boost::asio::buffer(outbound_data), endpoint) == 0)
|
||||||
{
|
{
|
||||||
return false;
|
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)
|
for (const auto& endpoint : endpoints)
|
||||||
{
|
{
|
||||||
socket.open(endpoint.protocol(), error);
|
socket.open(endpoint.protocol(), error);
|
||||||
socket.connect(endpoint, error);
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (socket.send(boost::asio::buffer(outbound_data)) == 0)
|
if (socket.send_to(boost::asio::buffer(outbound_data), endpoint) == 0)
|
||||||
{
|
{
|
||||||
return false;
|
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)
|
for (const auto& endpoint : endpoints)
|
||||||
{
|
{
|
||||||
socket.open(endpoint.protocol(), error);
|
socket.open(endpoint.protocol(), error);
|
||||||
socket.connect(endpoint, error);
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (socket.send(boost::asio::buffer(outbound_data)) == 0)
|
if (socket.send_to(boost::asio::buffer(outbound_data), endpoint) == 0)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -56,11 +56,10 @@ bool Gnss_Synchro_Udp_Sink::write_gnss_synchro(const std::vector<Gnss_Synchro>&
|
|||||||
for (const auto& endpoint : endpoints)
|
for (const auto& endpoint : endpoints)
|
||||||
{
|
{
|
||||||
socket.open(endpoint.protocol(), error);
|
socket.open(endpoint.protocol(), error);
|
||||||
socket.connect(endpoint, error);
|
|
||||||
|
|
||||||
try
|
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";
|
std::cerr << "Gnss_Synchro_Udp_Sink sent 0 bytes\n";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user