26 #ifndef NFD_DAEMON_FACE_UDP_CHANNEL_HPP 27 #define NFD_DAEMON_FACE_UDP_CHANNEL_HPP 51 time::nanoseconds idleTimeout,
52 bool wantCongestionMarking);
57 return m_socket.is_open();
63 return m_channelFaces.size();
100 handleNewPeer(
const boost::system::error_code& error,
101 size_t nBytesReceived,
105 std::pair<bool, shared_ptr<Face>>
112 boost::asio::ip::udp::socket m_socket;
113 std::array<uint8_t, ndn::MAX_NDN_PACKET_SIZE> m_receiveBuffer;
114 std::map<udp::Endpoint, shared_ptr<Face>> m_channelFaces;
115 const time::nanoseconds m_idleFaceTimeout;
116 bool m_wantCongestionMarking;
122 #endif // NFD_DAEMON_FACE_UDP_CHANNEL_HPP bool isListening() const override
Returns whether the channel is listening.
size_t size() const override
Returns the number of faces in the channel.
void connect(const udp::Endpoint &remoteEndpoint, const FaceParams ¶ms, const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onConnectFailed)
Create a unicast UDP face toward remoteEndpoint.
represent a channel that communicates on a local endpoint
function< void(const shared_ptr< Face > &face)> FaceCreatedCallback
Prototype for the callback that is invoked when a face is created (in response to an incoming connect...
function< void(uint32_t status, const std::string &reason)> FaceCreationFailedCallback
Prototype for the callback that is invoked when a face fails to be created.
Parameters used to set Transport properties or LinkService options on a newly created face...
Copyright (c) 2011-2015 Regents of the University of California.
UdpChannel(const udp::Endpoint &localEndpoint, time::nanoseconds idleTimeout, bool wantCongestionMarking)
Create a UDP channel on the given localEndpoint.
boost::asio::ip::udp::endpoint Endpoint
void listen(const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onFaceCreationFailed)
Start listening.
Class implementing UDP-based channel to create faces.