Implementation of Face abstraction that uses unicast UDP as underlying transport mechanism. More...
#include <udp-face.hpp>
Public Member Functions | |
UdpFace (const FaceUri &remoteUri, const FaceUri &localUri, protocol::socket socket, ndn::nfd::FacePersistency persistency, const time::seconds &idleTimeout) | |
ndn::nfd::FaceStatus | getFaceStatus () const 1 |
Public Member Functions inherited from nfd::DatagramFace< boost::asio::ip::udp > | |
DatagramFace (const FaceUri &remoteUri, const FaceUri &localUri, typename protocol::socket socket) | |
Construct datagram face. More... | |
void | sendInterest (const Interest &interest) 1 |
send an Interest More... | |
void | sendData (const Data &data) 1 |
send a Data More... | |
void | close () 1 |
Close the face. More... | |
void | receiveDatagram (const uint8_t *buffer, size_t nBytesReceived, const boost::system::error_code &error) |
Public Member Functions inherited from nfd::Face | |
Face (const FaceUri &remoteUri, const FaceUri &localUri, bool isLocal=false, bool isMultiAccess=false) | |
virtual | ~Face () |
FaceId | getId () const |
const std::string & | getDescription () const |
Get the description. More... | |
void | setDescription (const std::string &description) |
Set the face description. More... | |
void | setMetric (uint64_t metric) |
uint64_t | getMetric () const |
bool | isLocal () const |
Get whether face is connected to a local app. More... | |
ndn::nfd::FacePersistency | getPersistency () const |
Get the persistency setting. More... | |
bool | isMultiAccess () const |
Get whether packets sent by this face may reach multiple peers. More... | |
virtual bool | isUp () const |
Get whether underlying communication is up. More... | |
const FaceCounters & | getCounters () const |
const FaceUri & | getRemoteUri () const |
const FaceUri & | getLocalUri () const |
template<typename FaceTraits > | |
void | copyStatusTo (FaceTraits &traits) const |
Friends | |
class | UdpChannel |
Additional Inherited Members | |
Public Types inherited from nfd::DatagramFace< boost::asio::ip::udp > | |
typedef boost::asio::ip::udp | protocol |
Public Attributes inherited from nfd::Face | |
signal::Signal< Face, Interest > | onReceiveInterest |
fires when an Interest is received More... | |
signal::Signal< Face, Data > | onReceiveData |
fires when a Data is received More... | |
signal::Signal< Face, Interest > | onSendInterest |
fires when an Interest is sent out More... | |
signal::Signal< Face, Data > | onSendData |
fires when a Data is sent out More... | |
signal::Signal< Face, std::string > | onFail |
fires when face disconnects or fails to perform properly More... | |
Protected Member Functions inherited from nfd::DatagramFace< boost::asio::ip::udp > | |
void | processErrorCode (const boost::system::error_code &error) |
void | handleSend (const boost::system::error_code &error, size_t nBytesSent, const Block &payload) |
void | handleReceive (const boost::system::error_code &error, size_t nBytesReceived) |
void | keepFaceAliveUntilAllHandlersExecuted (const shared_ptr< Face > &face) |
void | closeSocket () |
bool | hasBeenUsedRecently () const |
void | resetRecentUsage () |
Set m_hasBeenUsedRecently to false. More... | |
NFD_LOG_INCLASS_DECLARE () | |
Protected Member Functions inherited from nfd::Face | |
void | setPersistency (ndn::nfd::FacePersistency persistency) |
bool | decodeAndDispatchInput (const Block &element) |
void | fail (const std::string &reason) |
fail the face and raise onFail event if it's UP; otherwise do nothing More... | |
FaceCounters & | getMutableCounters () |
Protected Attributes inherited from nfd::DatagramFace< boost::asio::ip::udp > | |
protocol::socket | m_socket |
Implementation of Face abstraction that uses unicast UDP as underlying transport mechanism.
Definition at line 38 of file udp-face.hpp.
nfd::UdpFace::UdpFace | ( | const FaceUri & | remoteUri, |
const FaceUri & | localUri, | ||
protocol::socket | socket, | ||
ndn::nfd::FacePersistency | persistency, | ||
const time::seconds & | idleTimeout | ||
) |
Definition at line 40 of file udp-face.cpp.
References ndn::nfd::FACE_PERSISTENCY_ON_DEMAND, nfd::Face::getPersistency(), nfd::DatagramFace< boost::asio::ip::udp >::m_socket, NFD_LOG_FACE_WARN, nfd::scheduler::schedule(), and nfd::Face::setPersistency().
|
virtual |
Reimplemented from nfd::Face.
Definition at line 75 of file udp-face.cpp.
References nfd::DatagramFace< boost::asio::ip::udp >::close(), ndn::nfd::FACE_PERSISTENCY_ON_DEMAND, nfd::Face::getFaceStatus(), nfd::Face::getPersistency(), nfd::DatagramFace< boost::asio::ip::udp >::hasBeenUsedRecently(), NFD_LOG_FACE_INFO, ndn::time::steady_clock::now(), nfd::DatagramFace< boost::asio::ip::udp >::resetRecentUsage(), and nfd::scheduler::schedule().
|
friend |
Definition at line 58 of file udp-face.hpp.