58 InternalForwarderTransport::doSend(
const Block& packet)
76 if (m_forwarder !=
nullptr) {
77 m_forwarder->setPeer(
nullptr);
86 if (m_forwarder !=
nullptr) {
88 m_forwarder->setPeer(
nullptr);
89 m_fwTransportStateConn.disconnect();
92 m_forwarder = forwarder;
94 if (m_forwarder !=
nullptr) {
97 m_fwTransportStateConn = m_forwarder->afterStateChange.connect(
100 connectToForwarder(
nullptr);
111 if (m_receiveCallback) {
112 m_receiveCallback(packet);
123 m_forwarder->receivePacket(wire);
void setPersistency(ndn::nfd::FacePersistency newPersistency)
changes face persistency setting
void connectToForwarder(InternalForwarderTransport *forwarder)
Connect to a forwarder-side transport.
#define NFD_LOG_FACE_TRACE(msg)
Log a message at TRACE level.
const ssize_t MTU_UNLIMITED
indicates the transport has no limit on payload size
TransportState
Indicates the state of a transport.
void setRemoteUri(const FaceUri &uri)
detail::SimulatorIo & getGlobalIoService()
Returns the global io_service instance for the calling thread.
Represents a TLV element of the NDN packet format.
void setLinkType(ndn::nfd::LinkType linkType)
void setScope(ndn::nfd::FaceScope scope)
#define NFD_LOG_FACE_DEBUG(msg)
Log a message at DEBUG level.
void receive(const Block &packet, const EndpointId &endpoint=0)
Pass a received link-layer packet to the upper layer for further processing.
size_t size() const
Return the size of the encoded wire, i.e., of the whole TLV.
Implements a forwarder-side transport that can be paired with another transport.
Copyright (c) 2011-2015 Regents of the University of California.
the transport is closed, and can be safely deallocated
void setPeer(InternalTransportBase *peer)
void post(const std::function< void()> &callback)
void doClose() final
performs Transport specific operations to close the transport
NFD_LOG_MEMBER_INIT(InternalForwarderTransport, InternalForwarderTransport)
void setLocalUri(const FaceUri &uri)
represents the underlying protocol and address used by a Face
void receivePacket(const Block &packet) final
void setState(TransportState newState)
set transport state
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 send(const Block &block) final
Send a TLV block through the transport.
~InternalClientTransport() final
virtual void receivePacket(const Block &packet)=0
void receivePacket(const Block &packet) final