26 #ifndef NFD_DAEMON_FACE_TCP_TRANSPORT_HPP
27 #define NFD_DAEMON_FACE_TCP_TRANSPORT_HPP
31 #include <boost/asio/ip/tcp.hpp>
47 TcpTransport(protocol::socket&& socket, ndn::nfd::FacePersistency persistency, ndn::nfd::FaceScope faceScope);
63 handleError(
const boost::system::error_code& error)
final;
70 handleReconnect(
const boost::system::error_code& error);
73 handleReconnectTimeout();
79 static constexpr time::milliseconds INITIAL_RECONNECT_DELAY = 1_s;
84 static constexpr time::milliseconds MAX_RECONNECT_DELAY = 5_min;
89 static constexpr
float RECONNECT_DELAY_MULTIPLIER = 2.0f;
92 typename protocol::endpoint m_remoteEndpoint;
96 scheduler::ScopedEventId m_reconnectEvent;
100 time::milliseconds m_nextReconnectWait;
Implements 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.
TcpTransport(protocol::socket &&socket, ndn::nfd::FacePersistency persistency, ndn::nfd::FaceScope faceScope)
void handleError(const boost::system::error_code &error) final
void afterChangePersistency(ndn::nfd::FacePersistency oldPersistency) final
Invoked after the persistency has been changed.
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)