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

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 final
 Returns whether the channel is listening. More...
 
size_t size () const final
 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...
 
void setPongTimeout (time::milliseconds timeout)
 
void handlePong (websocketpp::connection_hdl hdl)
 
void handlePongTimeout (websocketpp::connection_hdl hdl)
 
- Public Member Functions inherited from nfd::face::Channel
virtual ~Channel ()
 
const FaceUrigetUri () const
 
size_t getDefaultMtu () const
 Returns the default MTU for all faces created by this channel. More...
 

Public Attributes

NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE __pad0__: void setPingInterval(time::milliseconds interval)
 

Additional Inherited Members

- Protected Member Functions inherited from nfd::face::Channel
void setUri (const FaceUri &uri)
 
void setDefaultMtu (size_t mtu)
 

Detailed Description

Class implementing WebSocket-based channel to create faces.

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

Constructor & Destructor Documentation

◆ WebSocketChannel()

Member Function Documentation

◆ isListening()

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

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
inlinefinalvirtual

Returns the number of faces in the channel.

Implements nfd::face::Channel.

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

References NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE.

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

References isListening(), NFD_LOG_CHAN_DEBUG, NFD_LOG_CHAN_WARN, and websocketpp::server< config >::start_accept().

◆ setPongTimeout()

void nfd::face::WebSocketChannel::setPongTimeout ( time::milliseconds  timeout)
Precondition
listen hasn't been invoked

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

References websocketpp::endpoint< connection, config >::set_pong_timeout().

◆ handlePong()

◆ handlePongTimeout()

void nfd::face::WebSocketChannel::handlePongTimeout ( websocketpp::connection_hdl  hdl)

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

References NFD_LOG_CHAN_WARN.

Referenced by WebSocketChannel().

Member Data Documentation

◆ __pad0__

NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE nfd::face::WebSocketChannel::__pad0__

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


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