nfd::face::WebSocketChannel Class Referencefinal

Class implementing a WebSocket-based channel to create faces. More...

#include <daemon/face/websocket-channel.hpp>

+ Inheritance diagram for nfd::face::WebSocketChannel:
+ Collaboration diagram for nfd::face::WebSocketChannel:

Public Member Functions

 WebSocketChannel (const websocket::Endpoint &localEndpoint)
 Create a WebSocket channel for the given localEndpoint. More...
 
size_t getDefaultMtu () const noexcept
 Returns the default MTU for all faces created by this channel. More...
 
const FaceUri & getUri () const noexcept
 
bool isListening () const final
 Returns whether the channel is listening. More...
 
void listen (const FaceCreatedCallback &onFaceCreated)
 Enable listening on the local endpoint, accept connections, and create faces when remote host makes a connection. More...
 
size_t size () const final
 Returns the number of faces in the channel. More...
 

Protected Member Functions

void setDefaultMtu (size_t mtu) noexcept
 
void setUri (const FaceUri &uri) noexcept
 

Detailed Description

Class implementing a WebSocket-based channel to create faces.

Definition at line 43 of file websocket-channel.hpp.

Constructor & Destructor Documentation

◆ WebSocketChannel()

nfd::face::WebSocketChannel::WebSocketChannel ( const websocket::Endpoint localEndpoint)
explicit

Create a WebSocket channel for the given localEndpoint.

To enable the creation of faces upon incoming connections, one needs to explicitly call listen(). The created channel is bound to localEndpoint.

Definition at line 36 of file websocket-channel.cpp.

Member Function Documentation

◆ getDefaultMtu()

size_t nfd::face::Channel::getDefaultMtu ( ) const
inlinenoexceptinherited

Returns the default MTU for all faces created by this channel.

Definition at line 58 of file channel.hpp.

◆ getUri()

const FaceUri& nfd::face::Channel::getUri ( ) const
inlinenoexceptinherited

Definition at line 49 of file channel.hpp.

◆ isListening()

bool nfd::face::WebSocketChannel::isListening ( ) const
inlinefinalvirtual

Returns whether the channel is listening.

Implements nfd::face::Channel.

Definition at line 56 of file websocket-channel.hpp.

◆ listen()

void nfd::face::WebSocketChannel::listen ( const FaceCreatedCallback onFaceCreated)

Enable listening on the local endpoint, accept connections, and create faces when remote host makes a connection.

Parameters
onFaceCreatedCallback to notify successful creation of a face

Definition at line 150 of file websocket-channel.cpp.

◆ setDefaultMtu()

void nfd::face::Channel::setDefaultMtu ( size_t  mtu)
protectednoexceptinherited

Definition at line 40 of file channel.cpp.

◆ setUri()

void nfd::face::Channel::setUri ( const FaceUri &  uri)
protectednoexceptinherited

Definition at line 34 of file channel.cpp.

◆ size()

size_t nfd::face::WebSocketChannel::size ( ) const
inlinefinalvirtual

Returns the number of faces in the channel.

Implements nfd::face::Channel.

Definition at line 62 of file websocket-channel.hpp.