Class implementing WebSocket-based channel to create faces. More...
#include <websocket-channel.hpp>
Public Member Functions | |
WebSocketChannel (const websocket::Endpoint &localEndpoint) | |
Create WebSocket channel for the local endpoint. More... | |
bool | isListening () const override |
Returns whether the channel is listening. More... | |
size_t | size () const override |
Returns the number of faces in the channel. More... | |
void | listen (const FaceCreatedCallback &onFaceCreated) |
Enable listening on the local endpoint, accept connections, and create faces when remote host makes a connection. More... | |
Public Member Functions inherited from nfd::face::Channel | |
virtual | ~Channel () |
const FaceUri & | getUri () const |
Additional Inherited Members | |
Protected Member Functions inherited from nfd::face::Channel | |
void | setUri (const FaceUri &uri) |
Class implementing WebSocket-based channel to create faces.
Definition at line 43 of file websocket-channel.hpp.
|
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.
References nfd::getGlobalIoService(), NFD_LOG_CHAN_INFO, and nfd::face::Channel::setUri().
|
inlineoverridevirtual |
Returns whether the channel is listening.
Implements nfd::face::Channel.
Definition at line 57 of file websocket-channel.hpp.
Referenced by listen().
|
inlineoverridevirtual |
Returns the number of faces in the channel.
Implements nfd::face::Channel.
Definition at line 63 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.
onFaceCreated | Callback to notify successful creation of a face |
Definition at line 143 of file websocket-channel.cpp.
References isListening(), NFD_LOG_CHAN_DEBUG, and NFD_LOG_CHAN_WARN.