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

#include <websocket-factory.hpp>

Inheritance diagram for nfd::WebSocketFactory:
Collaboration diagram for nfd::WebSocketFactory:

Public Member Functions

shared_ptr< WebSocketChannelcreateChannel (const websocket::Endpoint &localEndpoint)
 Create WebSocket-based channel using websocket::Endpoint. More...
 
shared_ptr< WebSocketChannelcreateChannel (const std::string &localIp, const std::string &localPort)
 Create WebSocket-based channel using specified IP address and port number. More...
 
virtual void createFace (const FaceUri &uri, ndn::nfd::FacePersistency persistency, bool wantLocalFieldsEnabled, const FaceCreatedCallback &onCreated, const FaceCreationFailedCallback &onFailure) override
 Try to create Face using the supplied FaceUri. More...
 
virtual std::vector< shared_ptr< const Channel > > getChannels () const override
 

Detailed Description

Definition at line 34 of file websocket-factory.hpp.

Member Function Documentation

◆ createChannel() [1/2]

shared_ptr< WebSocketChannel > nfd::WebSocketFactory::createChannel ( const websocket::Endpoint localEndpoint)

Create WebSocket-based channel using websocket::Endpoint.

websocket::Endpoint is really an alias for boost::asio::ip::tcp::endpoint.

If this method called twice with the same endpoint, only one channel will be created. The second call will just retrieve the existing channel.

Returns
always a valid pointer to a WebSocketChannel object, an exception is thrown if it cannot be created.

Definition at line 33 of file websocket-factory.cpp.

Referenced by createChannel().

◆ createChannel() [2/2]

shared_ptr< WebSocketChannel > nfd::WebSocketFactory::createChannel ( const std::string &  localIp,
const std::string &  localPort 
)

Create WebSocket-based channel using specified IP address and port number.

This method is just a helper that converts a string representation of localIp and port to websocket::Endpoint and calls the other createChannel overload.

Definition at line 46 of file websocket-factory.cpp.

References createChannel().

◆ createFace()

void nfd::WebSocketFactory::createFace ( const FaceUri uri,
ndn::nfd::FacePersistency  persistency,
bool  wantLocalFieldsEnabled,
const FaceCreatedCallback onCreated,
const FaceCreationFailedCallback onFailure 
)
overridevirtual

Try to create Face using the supplied FaceUri.

This method should automatically choose channel, based on supplied FaceUri and create face.

Parameters
uriremote URI of the new face
persistencypersistency of the new face
wantLocalFieldsEnabledwhether local fields should be enabled on the face
onCreatedcallback if face creation succeeds If a face with the same remote URI already exists, its persistency and LocalFieldsEnabled setting will not be modified.
onFailurecallback if face creation fails

Implements nfd::ProtocolFactory.

Definition at line 54 of file websocket-factory.cpp.

◆ getChannels()

std::vector< shared_ptr< const Channel > > nfd::WebSocketFactory::getChannels ( ) const
overridevirtual

Implements nfd::ProtocolFactory.

Definition at line 64 of file websocket-factory.cpp.


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