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... | |
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 |
Get number of faces in the channel. More... | |
bool | isListening () const |
Public Member Functions inherited from nfd::Channel | |
virtual | ~Channel () |
const FaceUri & | getUri () const |
Additional Inherited Members | |
Protected Member Functions inherited from nfd::Channel | |
void | setUri (const FaceUri &uri) |
Class implementing WebSocket-based channel to create faces.
Definition at line 41 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 35 of file websocket-channel.cpp.
References nfd::connectFaceClosedSignal(), nfd::getGlobalIoService(), NFD_LOG_WARN, nfd::Channel::setUri(), and nfd::face::WebSocketTransport.
void nfd::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 138 of file websocket-channel.cpp.
References NFD_LOG_WARN.
size_t nfd::WebSocketChannel::size | ( | ) | const |
Get number of faces in the channel.
Definition at line 151 of file websocket-channel.cpp.
|
inline |
Definition at line 112 of file websocket-channel.hpp.