MADARA  3.4.1
MulticastTransportReadThread.cpp
Go to the documentation of this file.
2 
6 
7 #include <iostream>
8 #include <algorithm>
9 
10 namespace madara
11 {
12 namespace transport
13 {
14 namespace mcast = ip::multicast;
15 
17 {
18  if (transport_.addresses_.size() == 0)
19  {
20  return;
21  }
22 
23  try
24  {
25  transport_.socket_.set_option(
26  mcast::leave_group(transport_.addresses_[0].address()));
27  }
28  catch (const boost::system::system_error& e)
29  {
31  "MulticastTransportReadThread::close:"
32  " Error unsubscribing to multicast address: %s\n",
33  e.what());
34  }
35 
37 }
38 }
39 }
#define madara_logger_log(loggering, level,...)
Fast version of the madara::logger::log method.
Definition: Logger.h:20
logger::Logger & get_logger(void) const
Gets the logger used for information printing.
std::vector< udp::endpoint > addresses_
holds all multicast addresses we are sending to
udp::socket socket_
underlying socket
void cleanup(void) override
Cleanup function called by thread manager.
void cleanup(void) override
Cleanup function called by thread manager.
Copyright(c) 2020 Galois.