32 #include <netinet/in.h> 33 #include <sys/socket.h> 43 time::nanoseconds idleTimeout,
44 optional<ssize_t> overrideMtu)
46 , m_idleTimeout(idleTimeout)
77 const int value = IP_PMTUDISC_DONT;
78 if (::setsockopt(
m_socket.native_handle(), IPPROTO_IP,
79 IP_MTU_DISCOVER, &value,
sizeof(value)) < 0) {
80 NFD_LOG_FACE_WARN(
"Failed to disable path MTU discovery: " << std::strerror(errno));
85 m_idleTimeout > time::nanoseconds::zero()) {
86 scheduleClosureWhenIdle();
100 m_idleTimeout > time::nanoseconds::zero()) {
101 scheduleClosureWhenIdle();
104 m_closeIfIdleEvent.
cancel();
110 UnicastUdpTransport::scheduleClosureWhenIdle()
119 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
static constexpr ssize_t MIN_MTU
minimum MTU that may be set on a transport
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
void setScope(ndn::nfd::FaceScope scope)
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 cancel()
Cancel the operation.
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
UnicastUdpTransport(protocol::socket &&socket, ndn::nfd::FacePersistency persistency, time::nanoseconds idleTimeout, optional< ssize_t > overrideMtu={})
EventId schedule(time::nanoseconds after, const EventCallback &event)
Schedule an event.
#define NFD_LOG_FACE_WARN(msg)
Log a message at WARN level.