36 const protocol::endpoint& multicastGroup,
41 , m_multicastGroup(multicastGroup)
42 , m_sendSocket(
std::move(sendSocket))
59 m_sendSocket.async_send_to(boost::asio::buffer(packet.packet), m_multicastGroup,
61 boost::asio::placeholders::error,
62 boost::asio::placeholders::bytes_transferred,
67 MulticastUdpTransport::doClose()
69 if (m_sendSocket.is_open()) {
74 boost::system::error_code error;
75 m_sendSocket.cancel(error);
76 m_sendSocket.close(error);
87 BOOST_ASSERT(ep.address().is_v4());
89 return (static_cast<uint64_t>(ep.port()) << 32) |
90 static_cast<uint64_t
>(ep.address().to_v4().to_ulong());
void handleSend(const boost::system::error_code &error, size_t nBytesSent, const Block &payload)
void setPersistency(ndn::nfd::FacePersistency newPersistency)
changes face persistency setting
#define NFD_LOG_INCLASS_2TEMPLATE_SPECIALIZATION_DEFINE(cls, s1, s2, name)
#define NFD_LOG_FACE_TRACE(msg)
Log a message at TRACE level.
void setRemoteUri(const FaceUri &uri)
void doClose() override
performs Transport specific operations to close the transport
stores a packet along with the remote endpoint
void setLinkType(ndn::nfd::LinkType linkType)
Implements Transport for datagram-based protocols.
ssize_t computeMtu(const Endpoint &localEndpoint)
computes maximum payload size in a UDP packet
void setScope(ndn::nfd::FaceScope scope)
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.
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.
void setLocalUri(const FaceUri &uri)
represents the underlying protocol and address used by a Face
Catch-all error for socket component errors that don't fit in other categories.
boost::asio::ip::udp protocol
uint64_t EndpointId
identifies an endpoint on the link