36 ndn::nfd::FaceScope scope, ndn::nfd::LinkType linkType)
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);
129 ndn::EncodingBuffer encoder(header.size() + payload.size(), header.size() + payload.size());
130 encoder.appendByteArray(header.wire(), header.size());
131 encoder.appendByteArray(payload.wire(), payload.size());
133 send(encoder.block());
void setLocalUri(const FaceUri &uri)
#define NFD_LOG_FACE_TRACE(msg)
Log a message at TRACE level.
Implements a forwarder-side transport that can be paired with another transport.
void setScope(ndn::nfd::FaceScope scope)
void send(const Block &packet)
Send a link-layer packet.
const ssize_t MTU_UNLIMITED
indicates the transport has no limit on payload size
TransportState
Indicates the state of a transport.
#define NFD_LOG_FACE_DEBUG(msg)
Log a message at DEBUG level.
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)
virtual void receivePacket(const Block &packet)=0
void doClose() final
performs Transport specific operations to close the transport
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
void connectToForwarder(InternalForwarderTransport *forwarder)
Connect to a forwarder-side transport.
the transport is closed, and can be safely deallocated
void send(const Block &wire) final
void setLinkType(ndn::nfd::LinkType linkType)
void setPeer(InternalTransportBase *peer)
void setPersistency(ndn::nfd::FacePersistency newPersistency)
changes face persistency setting
~InternalClientTransport() final
void receivePacket(const Block &packet) final
#define NFD_LOG_MEMBER_INIT(cls, name)
void receive(const Block &packet, const EndpointId &endpoint=0)
Pass a received link-layer packet to the upper layer for further processing.
void setState(TransportState newState)
set transport state
void setRemoteUri(const FaceUri &uri)
void receivePacket(const Block &packet) final
boost::asio::io_service & getGlobalIoService()
Returns the global io_service instance for the calling thread.