19 namespace mcast = ip::multicast;
23 bool launch_transport)
41 asio::socket_base::reuse_address reuse_option(
true);
42 socket_.set_option(reuse_option);
44 catch (
const boost::system::system_error& e)
47 "MulticastTransport::setup:"
48 " Error setting up read socket: %s\n",
64 catch (
const boost::system::system_error& e)
67 "MulticastTransport::setup_read_socket:"
68 " Error subscribing: %s\n",
87 socket_.set_option(mcast::hops(1));
89 catch (
const boost::system::system_error& e)
92 "MulticastTransport::setup_write_socket:"
93 " Error setting TTL: %s\n",
#define madara_logger_log(loggering, level,...)
Fast version of the madara::logger::log method.
This class stores variables and their values for use by any entity needing state information in a thr...
logger::Logger & get_logger(void) const
Gets the logger used for information printing.
void run(const std::string &name, BaseThread *thread, bool paused=false)
Starts a new thread and executes the provided user thread once.
madara::knowledge::ThreadSafeContext & context_
void invalidate_transport(void)
Invalidates a transport to indicate it is shutting down.
threads::Threader read_threads_
threads for reading knowledge updates
std::vector< udp::endpoint > addresses_
holds all multicast addresses we are sending to
udp::socket socket_
underlying socket
int setup() override
all subclasses should call this method at the end of its setup
friend class MulticastTransportReadThread
MulticastTransport(const std::string &id, madara::knowledge::ThreadSafeContext &context, TransportSettings &config, bool launch_transport)
Constructor.
int setup_read_thread(double hertz, const std::string &name) override
int setup_read_socket() override
int setup_write_socket() override
Holds basic transport settings.
UDP-based transport for knowledge.
int setup_write_socket() override
int setup_read_socket() override
Copyright(c) 2020 Galois.