Class implementing UDP-based channel to create faces. More...
#include <daemon/face/udp-channel.hpp>
Public Member Functions | |
UdpChannel (const udp::Endpoint &localEndpoint, time::nanoseconds idleTimeout, bool wantCongestionMarking) | |
Create a UDP channel on the given localEndpoint . More... | |
void | connect (const udp::Endpoint &remoteEndpoint, const FaceParams ¶ms, const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onConnectFailed) |
Create a unicast UDP face toward remoteEndpoint . More... | |
const FaceUri & | getUri () const |
bool | isListening () const override |
Returns whether the channel is listening. More... | |
void | listen (const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onFaceCreationFailed) |
Start listening. More... | |
size_t | size () const override |
Returns the number of faces in the channel. More... | |
Protected Member Functions | |
void | setUri (const FaceUri &uri) |
Class implementing UDP-based channel to create faces.
Definition at line 40 of file udp-channel.hpp.
nfd::face::UdpChannel::UdpChannel | ( | const udp::Endpoint & | localEndpoint, |
time::nanoseconds | idleTimeout, | ||
bool | wantCongestionMarking | ||
) |
Create a UDP channel on the given localEndpoint
.
To enable creation of faces upon incoming connections, one needs to explicitly call UdpChannel::listen method. The created socket is bound to localEndpoint
.
Definition at line 39 of file udp-channel.cpp.
void nfd::face::UdpChannel::connect | ( | const udp::Endpoint & | remoteEndpoint, |
const FaceParams & | params, | ||
const FaceCreatedCallback & | onFaceCreated, | ||
const FaceCreationFailedCallback & | onConnectFailed | ||
) |
Create a unicast UDP face toward remoteEndpoint
.
Definition at line 52 of file udp-channel.cpp.
|
inlineinherited |
Definition at line 48 of file channel.hpp.
|
inlineoverridevirtual |
Returns whether the channel is listening.
Implements nfd::face::Channel.
Definition at line 55 of file udp-channel.hpp.
void nfd::face::UdpChannel::listen | ( | const FaceCreatedCallback & | onFaceCreated, |
const FaceCreationFailedCallback & | onFaceCreationFailed | ||
) |
Start listening.
Enable listening on the local endpoint, waiting for incoming datagrams, and creating a face when a datagram is received from a new remote host.
Faces created in this way will have on-demand persistency.
onFaceCreated | Callback to notify successful creation of a face |
onFaceCreationFailed | Callback to notify errors |
Definition at line 74 of file udp-channel.cpp.
|
protectedinherited |
Definition at line 35 of file channel.cpp.
|
inlineoverridevirtual |
Returns the number of faces in the channel.
Implements nfd::face::Channel.
Definition at line 61 of file udp-channel.hpp.