26 #ifndef NFD_DAEMON_FACE_MULTICAST_UDP_TRANSPORT_HPP
27 #define NFD_DAEMON_FACE_MULTICAST_UDP_TRANSPORT_HPP
31 #include <boost/asio/ip/udp.hpp>
32 #include <ndn-cxx/net/network-interface.hpp>
44 class Error :
public std::runtime_error
47 using std::runtime_error::runtime_error;
58 boost::asio::ip::udp::socket&& recvSocket,
59 boost::asio::ip::udp::socket&& sendSocket,
60 ndn::nfd::LinkType linkType);
70 const boost::asio::ip::udp::endpoint& multicastGroup,
71 const boost::asio::ip::address& localAddress = {},
72 const ndn::net::NetworkInterface* netif =
nullptr);
79 const boost::asio::ip::udp::endpoint& localEndpoint,
80 const ndn::net::NetworkInterface* netif =
nullptr,
81 bool enableLoopback =
false);
85 doSend(
const Block& packet)
final;
91 boost::asio::ip::udp::endpoint m_multicastGroup;
92 boost::asio::ip::udp::socket m_sendSocket;
Implements a Transport for datagram-based protocols.
A Transport that communicates on a UDP multicast group.
MulticastUdpTransport(const boost::asio::ip::udp::endpoint &multicastGroup, boost::asio::ip::udp::socket &&recvSocket, boost::asio::ip::udp::socket &&sendSocket, ndn::nfd::LinkType linkType)
Creates a UDP-based transport for multicast communication.
static void openRxSocket(boost::asio::ip::udp::socket &sock, const boost::asio::ip::udp::endpoint &multicastGroup, const boost::asio::ip::address &localAddress={}, const ndn::net::NetworkInterface *netif=nullptr)
Opens and configures the receive-side socket.
ssize_t getSendQueueLength() final
Returns the current send queue length of the transport (in octets).
static void openTxSocket(boost::asio::ip::udp::socket &sock, const boost::asio::ip::udp::endpoint &localEndpoint, const ndn::net::NetworkInterface *netif=nullptr, bool enableLoopback=false)
Opens and configures the transmit-side socket.
#define NFD_LOG_MEMBER_DECL_SPECIALIZED(cls)