52 BOOST_THROW_EXCEPTION(
53 std::invalid_argument(
"InternalForwarderTransport supports only FACE_PERSISTENCY_PERMANENT"));
68 InternalForwarderTransport::doSend(
Packet&& packet)
98 m_fwToClientTransmitConn.disconnect();
99 m_clientToFwTransmitConn.disconnect();
100 m_fwTransportStateConn.disconnect();
102 if (forwarderTransport !=
nullptr) {
108 this->connectToForwarder(
nullptr);
117 if (m_receiveCallback) {
118 m_receiveCallback(packet);
133 encoder.appendByteArray(payload.
wire(), payload.
size());
135 this->
send(encoder.block());
virtual void beforeChangePersistency(ndn::nfd::FacePersistency newPersistency) override
invoked before persistency is changed
implements a client-side transport that can be paired with another
static void asyncReceive(InternalTransportBase *recipient, const Block &packet)
#define NFD_LOG_FACE_TRACE(msg)
Log a message at TRACE level.
void connectToForwarder(InternalForwarderTransport *forwarderTransport)
connect to a forwarder-side transport
void setPersistency(ndn::nfd::FacePersistency persistency)
changes face persistency setting
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)
represents the underlying protocol and address used by a Face
signal::Signal< InternalTransportBase, Block > afterSend
stores a packet along with the remote endpoint
const uint8_t * wire() const
detail::SimulatorIo & getGlobalIoService()
Class representing a wire element of NDN-TLV packet format.
#define NFD_LOG_DEBUG(expression)
void setLinkType(ndn::nfd::LinkType linkType)
virtual void receiveFromLink(const Block &packet)=0
causes the transport to receive a link-layer packet
abstracts a transport that can be paired with another
virtual void receiveFromLink(const Block &packet) override
causes the transport to receive a link-layer packet
void send(Packet &&packet)
send a link-layer packet
void setScope(ndn::nfd::FaceScope scope)
#define emitSignal(...)
(implementation detail)
implements a forwarder-side transport that can be paired with another
EncodingImpl< EncoderTag > EncodingBuffer
#define NFD_LOG_FACE_INFO(msg)
Log a message at INFO level.
Copyright (c) 2011-2015 Regents of the University of California.
signal::Signal< Transport, TransportState, TransportState > afterStateChange
signals when transport state changes
the transport is closed, and can be safely deallocated
void post(const std::function< void()> &callback)
void setLocalUri(const FaceUri &uri)
size_t appendByteArray(const uint8_t *array, size_t length)
Append a byte array array of length length.
virtual void receiveFromLink(const Block &packet) override
causes the transport to receive a link-layer packet
virtual void doClose() override
performs Transport specific operations to close the transport
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 receive(Packet &&packet)
receive a link-layer packet
virtual void send(const Block &wire) override
send a TLV block through the transport
Block packet
the packet as a TLV block
#define NFD_LOG_INCLASS_DEFINE(cls, name)