multicast-udp-transport.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_DAEMON_FACE_MULTICAST_UDP_TRANSPORT_HPP
27 #define NFD_DAEMON_FACE_MULTICAST_UDP_TRANSPORT_HPP
28 
29 #include "datagram-transport.hpp"
30 
31 namespace nfd {
32 namespace face {
33 
34 // Explicit specialization of makeEndpointId for the UDP multicast case.
35 // Note that this "shall be declared before the first use of the specialization
36 // that would cause an implicit instantiation to take place, in every translation
37 // unit in which such a use occurs".
38 template<>
41 
45 class MulticastUdpTransport final : public DatagramTransport<boost::asio::ip::udp, Multicast>
46 {
47 public:
56  MulticastUdpTransport(const protocol::endpoint& localEndpoint,
57  const protocol::endpoint& multicastGroup,
58  protocol::socket&& recvSocket,
59  protocol::socket&& sendSocket,
60  ndn::nfd::LinkType linkType);
61 
62 private:
63  void
64  doSend(Transport::Packet&& packet) final;
65 
66  void
67  doClose() final;
68 
69 private:
70  protocol::endpoint m_multicastGroup;
71  protocol::socket m_sendSocket;
72 };
73 
74 } // namespace face
75 } // namespace nfd
76 
77 #endif // NFD_DAEMON_FACE_MULTICAST_UDP_TRANSPORT_HPP
stores a packet along with the remote endpoint
Definition: transport.hpp:113
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
Definition: algorithm.hpp:32
static EndpointId makeEndpointId(const typename protocol::endpoint &ep)
uint64_t EndpointId
identifies an endpoint on the link
Definition: transport.hpp:109
A Transport that communicates on a UDP multicast group.
Implements Transport for datagram-based protocols.
MulticastUdpTransport(const protocol::endpoint &localEndpoint, const protocol::endpoint &multicastGroup, protocol::socket &&recvSocket, protocol::socket &&sendSocket, ndn::nfd::LinkType linkType)
Creates a UDP-based transport for multicast communication.