26 #ifndef NFD_DAEMON_FACE_TCP_TRANSPORT_HPP
27 #define NFD_DAEMON_FACE_TCP_TRANSPORT_HPP
31 #include <ndn-cxx/util/scheduler.hpp>
33 #include <boost/asio/ip/tcp.hpp>
50 ndn::nfd::FacePersistency persistency,
51 ndn::nfd::FaceScope faceScope);
67 handleError(
const boost::system::error_code& error)
final;
74 handleReconnect(
const boost::system::error_code& error);
77 handleReconnectTimeout();
83 static constexpr time::milliseconds INITIAL_RECONNECT_DELAY = 1_s;
88 static constexpr time::milliseconds MAX_RECONNECT_DELAY = 5_min;
93 static constexpr
float RECONNECT_DELAY_MULTIPLIER = 2.0f;
96 boost::asio::ip::tcp::endpoint m_remoteEndpoint;
99 ndn::scheduler::ScopedEventId m_reconnectEvent;
100 time::milliseconds m_nextReconnectWait;
Implements a Transport for stream-based protocols.
A Transport that communicates on a connected TCP socket.
bool canChangePersistencyToImpl(ndn::nfd::FacePersistency newPersistency) const final
Invoked by canChangePersistencyTo to perform the check.
void handleError(const boost::system::error_code &error) final
void afterChangePersistency(ndn::nfd::FacePersistency oldPersistency) final
Invoked after the persistency has been changed.
TcpTransport(boost::asio::ip::tcp::socket &&socket, ndn::nfd::FacePersistency persistency, ndn::nfd::FaceScope faceScope)
ssize_t getSendQueueLength() final
Returns the current send queue length of the transport (in octets).
void doClose() final
Performs Transport specific operations to close the transport.
#define NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE
#define NFD_VIRTUAL_WITH_TESTS
#define NFD_FINAL_UNLESS_WITH_TESTS
#define NFD_PROTECTED_WITH_TESTS_ELSE_PRIVATE
#define NFD_LOG_MEMBER_DECL_SPECIALIZED(cls)