35 const FaceUri& localUri,
const FaceUri& remoteUri,
36 ndn::nfd::FaceScope scope, ndn::nfd::LinkType linkType)
59 InternalForwarderTransport::doSend(
Packet&& packet)
63 this->emitSignal(
afterSend, packet.packet);
89 m_fwToClientTransmitConn.disconnect();
90 m_clientToFwTransmitConn.disconnect();
91 m_fwTransportStateConn.disconnect();
93 if (forwarderTransport !=
nullptr) {
99 this->connectToForwarder(
nullptr);
108 if (m_receiveCallback) {
109 m_receiveCallback(packet);
122 ndn::EncodingBuffer encoder(header.size() + payload.size(), header.size() + payload.size());
123 encoder.appendByteArray(header.wire(), header.size());
124 encoder.appendByteArray(payload.wire(), payload.size());
126 this->
send(encoder.block());
void setLocalUri(const FaceUri &uri)
static void asyncReceive(InternalTransportBase *recipient, const Block &packet)
#define NFD_LOG_DEBUG(expression)
#define NFD_LOG_FACE_TRACE(msg)
Log a message at TRACE level.
implements a forwarder-side transport that can be paired with another
void setScope(ndn::nfd::FaceScope scope)
const ssize_t MTU_UNLIMITED
indicates the transport has no limit on payload size
TransportState
indicates the state of a transport
Block packet
the packet as a TLV block
signal::Signal< Transport, TransportState, TransportState > afterStateChange
signals when transport state changes
virtual void receiveFromLink(const Block &packet)=0
causes the transport to receive a link-layer packet
void receive(Packet &&packet)
receive a link-layer packet
stores a packet along with the remote endpoint
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)
#define NFD_LOG_INCLASS_DEFINE(cls, name)
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
the transport is closed, and can be safely deallocated
#define NFD_LOG_FACE_INFO(msg)
Log a message at INFO level.
void connectToForwarder(InternalForwarderTransport *forwarderTransport)
connect to a forwarder-side transport
void setLinkType(ndn::nfd::LinkType linkType)
void send(Packet &&packet)
send a link-layer packet
void setPersistency(ndn::nfd::FacePersistency newPersistency)
changes face persistency setting
void doClose() override
performs Transport specific operations to close the transport
void send(const Block &wire) override
void receiveFromLink(const Block &packet) override
causes the transport to receive a link-layer packet
void setState(TransportState newState)
set transport state
void setRemoteUri(const FaceUri &uri)
signal::Signal< InternalTransportBase, Block > afterSend
abstracts a transport that can be paired with another
implements a client-side transport that can be paired with another
void receiveFromLink(const Block &packet) override
causes the transport to receive a link-layer packet
boost::asio::io_service & getGlobalIoService()