in spectator/publisher.cc [110:125]
void SpectatordPublisher::setup_udp(absl::string_view host_port) {
auto endpoint = resolve_host_port(io_context_, host_port);
udp_reconnect(endpoint);
sender_ = [endpoint, this](std::string_view msg) {
for (auto i = 0; i < 3; ++i) {
try {
udp_socket_.send(asio::buffer(msg));
logger_->trace("Sent (udp): {}", msg);
break;
} catch (std::exception& e) {
logger_->warn("Unable to send {} - attempt {}/3", msg, i);
udp_reconnect(endpoint);
}
}
};
}