26 #ifndef NFD_DAEMON_FACE_UDP_CHANNEL_HPP 27 #define NFD_DAEMON_FACE_UDP_CHANNEL_HPP 51 time::nanoseconds idleTimeout);
56 return m_socket.is_open();
62 return m_channelFaces.size();
76 ndn::nfd::FacePersistency persistency,
77 bool wantLpReliability,
106 handleNewPeer(
const boost::system::error_code& error,
107 size_t nBytesReceived,
111 std::pair<bool, shared_ptr<Face>>
113 ndn::nfd::FacePersistency persistency,
114 bool wantLpReliability);
119 boost::asio::ip::udp::socket m_socket;
120 std::array<uint8_t, ndn::MAX_NDN_PACKET_SIZE> m_receiveBuffer;
121 std::map<udp::Endpoint, shared_ptr<Face>> m_channelFaces;
122 const time::nanoseconds m_idleFaceTimeout;
128 #endif // NFD_DAEMON_FACE_UDP_CHANNEL_HPP void listen(const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onFaceCreationFailed)
Start listening.
UdpChannel(const udp::Endpoint &localEndpoint, time::nanoseconds idleTimeout)
Create a UDP channel on the given localEndpoint.
size_t size() const override
Returns the number of faces in the channel.
void connect(const udp::Endpoint &remoteEndpoint, ndn::nfd::FacePersistency persistency, bool wantLpReliability, const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onConnectFailed)
Create a unicast UDP face toward remoteEndpoint.
Class implementing UDP-based channel to create faces.
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
function< void(uint32_t status, const std::string &reason)> FaceCreationFailedCallback
Prototype for the callback that is invoked when a face fails to be created.
boost::asio::ip::udp::endpoint Endpoint
represent a channel that communicates on a local endpoint
bool isListening() const override
Returns whether the channel is listening.
function< void(const shared_ptr< Face > &newFace)> FaceCreatedCallback
Prototype for the callback that is invoked when a face is created (in response to an incoming connect...