nfd::face::WebSocketChannel Class Reference

Class implementing 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 WebSocket channel for the local endpoint. More...
 
const FaceUri & getUri () const
 
bool isListening () const override
 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 override
 Returns the number of faces in the channel. More...
 

Protected Member Functions

void setUri (const FaceUri &uri)
 

Detailed Description

Class implementing WebSocket-based channel to create faces.

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

Constructor & Destructor Documentation

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

Create WebSocket channel for the local endpoint.

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

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

Member Function Documentation

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

Definition at line 59 of file channel.hpp.

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

Returns whether the channel is listening.

Implements nfd::face::Channel.

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

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 149 of file websocket-channel.cpp.

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

Definition at line 34 of file channel.cpp.

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

Returns the number of faces in the channel.

Implements nfd::face::Channel.

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