NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
nfd::face::WebSocketChannel Class Reference

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

#include <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...
 
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 FaceUrigetUri () const
 

Additional Inherited Members

- Protected Member Functions inherited from nfd::face::Channel
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

◆ WebSocketChannel()

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.

References nfd::getGlobalIoService(), NFD_LOG_CHAN_INFO, and nfd::face::Channel::setUri().

Member Function Documentation

◆ isListening()

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.

Referenced by listen().

◆ size()

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.

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

References isListening(), NFD_LOG_CHAN_DEBUG, and NFD_LOG_CHAN_WARN.


The documentation for this class was generated from the following files: