| 50 | UDPEndpoint::~UDPEndpoint() { m_receiver_sender->stopBackground(); } |
| 51 | |
| 52 | bool UDPEndpoint::sendMessagesImpl( |
| 53 | const std::vector<MavlinkMessage>& messages) { |
| 54 | auto message_buffers = aggregate_pack_messages(messages); |
| 55 | const auto other_ips = get_all_curr_dest_ips(); |
| 56 | for (const auto& message_buffer : message_buffers) { |
| 57 | m_receiver_sender->forwardPacketViaUDP( |
| 58 | SENDER_IP, SEND_PORT, message_buffer.aggregated_data->data(), |
| 59 | message_buffer.aggregated_data->size()); |
| 60 | for (const auto& ip : other_ips) { |
| 61 | m_receiver_sender->forwardPacketViaUDP( |
| 62 | ip, SEND_PORT, message_buffer.aggregated_data->data(), |
| 63 | message_buffer.aggregated_data->size()); |
| 64 | } |
| 65 | } |
| 66 | return true; |
| 67 | } |
| 68 | |
| 69 | void UDPEndpoint::addAnotherDestIpAddress(const std::string& ip) { |
| 70 | std::lock_guard<std::mutex> lock(m_sender_mutex); |
nothing calls this directly
no test coverage detected