29 #include <boost/asio/post.hpp>
37 ndn::nfd::FaceScope scope, ndn::nfd::LinkType linkType)
59 InternalForwarderTransport::doSend(
const Block& packet)
77 if (m_forwarder !=
nullptr) {
87 if (m_forwarder !=
nullptr) {
90 m_fwTransportStateConn.disconnect();
93 m_forwarder = forwarder;
95 if (m_forwarder !=
nullptr) {
112 if (m_receiveCallback) {
113 m_receiveCallback(packet);
void connectToForwarder(InternalForwarderTransport *forwarder)
Connect to a forwarder-side transport.
void receivePacket(const Block &packet) final
void send(const Block &block) final
~InternalClientTransport() final
Implements a forwarder-side transport that can be paired with another transport.
void setPeer(InternalTransportBase *peer) noexcept
InternalForwarderTransport(const FaceUri &localUri=FaceUri("internal://"), const FaceUri &remoteUri=FaceUri("internal://"), ndn::nfd::FaceScope scope=ndn::nfd::FACE_SCOPE_LOCAL, ndn::nfd::LinkType linkType=ndn::nfd::LINK_TYPE_POINT_TO_POINT)
void doClose() final
Performs Transport specific operations to close the transport.
void receivePacket(const Block &packet) final
virtual void receivePacket(const Block &packet)=0
void setScope(ndn::nfd::FaceScope scope) noexcept
void receive(const Block &packet, const EndpointId &endpoint={})
Pass a received link-layer packet to the upper layer for further processing.
void setPersistency(ndn::nfd::FacePersistency newPersistency)
Changes the persistency setting of the transport.
void setMtu(ssize_t mtu) noexcept
signal::Signal< Transport, TransportState, TransportState > afterStateChange
Called when the transport state changes.
void setState(TransportState newState)
Set transport state.
void setLocalUri(const FaceUri &uri) noexcept
void setLinkType(ndn::nfd::LinkType linkType) noexcept
void setRemoteUri(const FaceUri &uri) noexcept
#define NFD_LOG_FACE_DEBUG(msg)
Log a message at DEBUG level.
#define NFD_LOG_FACE_TRACE(msg)
Log a message at TRACE level.
#define NFD_LOG_MEMBER_INIT(cls, name)
TransportState
Indicates the state of a transport.
@ CLOSED
the transport is closed, and can be safely deallocated
constexpr ssize_t MTU_UNLIMITED
Indicates that the transport has no limit on payload size.
boost::asio::io_context & getGlobalIoService()
Returns the global io_context instance for the calling thread.