33 #include <netinet/in.h> 34 #include <sys/socket.h> 46 , m_idleTimeout(idleTimeout)
70 const int value = IP_PMTUDISC_DONT;
71 if (::setsockopt(
m_socket.native_handle(), IPPROTO_IP,
73 NFD_LOG_FACE_WARN(
"Failed to disable path MTU discovery: " << std::strerror(errno));
78 m_idleTimeout > time::nanoseconds::zero()) {
79 scheduleClosureWhenIdle();
93 m_idleTimeout > time::nanoseconds::zero()) {
94 scheduleClosureWhenIdle();
97 m_closeIfIdleEvent.
cancel();
103 UnicastUdpTransport::scheduleClosureWhenIdle()
105 m_closeIfIdleEvent =
getScheduler().schedule(m_idleTimeout, [
this] {
112 scheduleClosureWhenIdle();
void setPersistency(ndn::nfd::FacePersistency newPersistency)
changes face persistency setting
void setExpirationTime(const time::steady_clock::TimePoint &expirationTime)
NFD_LOG_MEMBER_INIT_SPECIALIZED((DatagramTransport< boost::asio::ip::udp, Multicast >), MulticastUdpTransport)
bool canChangePersistencyToImpl(ndn::nfd::FacePersistency newPersistency) const final
invoked by canChangePersistencyTo to perform the check
void setRemoteUri(const FaceUri &uri)
static time_point now() noexcept
protocol::socket m_socket
void close()
Request the transport to be closed.
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
UnicastUdpTransport(protocol::socket &&socket, ndn::nfd::FacePersistency persistency, time::nanoseconds idleTimeout)
void setScope(ndn::nfd::FaceScope scope)
Scheduler & getScheduler()
Returns the global Scheduler instance for the calling thread.
#define NFD_LOG_FACE_DEBUG(msg)
Log a message at DEBUG level.
bool hasRecentlyReceived() const
#define NFD_LOG_FACE_INFO(msg)
Log a message at INFO level.
Copyright (c) 2011-2015 Regents of the University of California.
void resetRecentlyReceived()
void setLocalUri(const FaceUri &uri)
represents the underlying protocol and address used by a Face
void afterChangePersistency(ndn::nfd::FacePersistency oldPersistency) final
invoked after the persistency has been changed
ndn::nfd::FacePersistency getPersistency() const
void cancel()
Cancel the operation.
Catch-all error for socket component errors that don't fit in other categories.
boost::chrono::nanoseconds nanoseconds
#define NFD_LOG_FACE_WARN(msg)
Log a message at WARN level.