36 const protocol::endpoint& multicastGroup,
37 protocol::socket&& recvSocket,
38 protocol::socket&& sendSocket)
40 , m_multicastGroup(multicastGroup)
41 , m_sendSocket(
std::move(sendSocket))
43 this->setLocalUri(
FaceUri(localEndpoint));
44 this->setRemoteUri(
FaceUri(multicastGroup));
57 BOOST_THROW_EXCEPTION(
58 std::invalid_argument(
"MulticastUdpTransport supports only FACE_PERSISTENCY_PERMANENT"));
67 m_sendSocket.async_send_to(boost::asio::buffer(packet.packet), m_multicastGroup,
68 bind(&MulticastUdpTransport::handleSend,
this,
69 boost::asio::placeholders::error,
70 boost::asio::placeholders::bytes_transferred,
75 MulticastUdpTransport::doClose()
77 if (m_sendSocket.is_open()) {
82 boost::system::error_code error;
83 m_sendSocket.cancel(error);
84 m_sendSocket.close(error);
95 BOOST_ASSERT(ep.address().is_v4());
97 return (static_cast<uint64_t>(ep.port()) << 32) |
98 static_cast<uint64_t
>(ep.address().to_v4().to_ulong());
#define NFD_LOG_FACE_TRACE(msg)
Log a message at TRACE level.
represents the underlying protocol and address used by a Face
stores a packet along with the remote endpoint
Implements Transport for datagram-based protocols.
virtual void doClose() 1
performs Transport specific operations to close the transport
static EndpointId makeEndpointId(const typename protocol::endpoint &ep)
#define NFD_LOG_FACE_INFO(msg)
Log a message at INFO level.
Copyright (c) 2011-2015 Regents of the University of California.
#define NFD_LOG_INCLASS_2TEMPLATE_SPECIALIZATION_DEFINE(cls, s1, s2, name)
ssize_t computeMtu(const boost::asio::ip::udp::endpoint &localEndpoint)
computes maximum payload size in a UDP packet
uint64_t EndpointId
identifies an endpoint on the link