26 #ifndef NFD_DAEMON_FACE_UDP_CHANNEL_HPP
27 #define NFD_DAEMON_FACE_UDP_CHANNEL_HPP
34 typedef boost::asio::ip::udp::endpoint
Endpoint;
54 const time::seconds& timeout);
69 ndn::nfd::FacePersistency persistency,
102 handleNewPeer(
const boost::system::error_code& error,
103 size_t nBytesReceived,
107 std::pair<bool, shared_ptr<Face>>
108 createFace(
const udp::Endpoint& remoteEndpoint, ndn::nfd::FacePersistency persistency);
111 std::map<udp::Endpoint, shared_ptr<Face>> m_channelFaces;
123 boost::asio::ip::udp::socket m_socket;
128 time::seconds m_idleFaceTimeout;
130 uint8_t m_inputBuffer[ndn::MAX_NDN_PACKET_SIZE];
136 return m_socket.is_open();
141 #endif // NFD_DAEMON_FACE_UDP_CHANNEL_HPP
void listen(const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onReceiveFailed)
Enable listening on the local endpoint, accept connections, and create faces when remote host makes a...
void connect(const udp::Endpoint &remoteEndpoint, ndn::nfd::FacePersistency persistency, const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onConnectFailed)
Create a face by establishing connection to remote endpoint.
UdpChannel(const udp::Endpoint &localEndpoint, const time::seconds &timeout)
Create UDP channel for the local endpoint.
size_t size() const
Get number of faces in the channel.
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
boost::asio::ip::udp::endpoint Endpoint
function< void(uint32_t status, const std::string &reason)> FaceCreationFailedCallback
Prototype for the callback that is invoked when the face fails to be created.
function< void(const shared_ptr< Face > &newFace)> FaceCreatedCallback
Prototype for the callback that is invoked when the face is created (as a response to incoming connec...
Class implementing UDP-based channel to create faces.