NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: 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:

Classes

class  Error
 Exception of WebSocketFactory. More...
 

Public Member Functions

 WebSocketFactory (const std::string &defaultPort)
 
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 &port)
 Create WebSocket-based channel using specified IP address and port number. More...
 
virtual void createFace (const FaceUri &uri, ndn::nfd::FacePersistency persistency, const FaceCreatedCallback &onCreated, const FaceConnectFailedCallback &onConnectFailed) 1
 Try to create Face using the supplied FaceUri. More...
 
virtual std::list< shared_ptr< const Channel > > getChannels () const
 

Detailed Description

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

Constructor & Destructor Documentation

nfd::WebSocketFactory::WebSocketFactory ( const std::string &  defaultPort)
explicit

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

Referenced by nfd::WebSocketFactory::Error::Error().

Member Function Documentation

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.
Exceptions
WebSocketFactory::Error

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

Referenced by createChannel(), and nfd::WebSocketFactory::Error::Error().

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

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.

Exceptions
WebSocketFactory::Error

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

References createChannel().

void nfd::WebSocketFactory::createFace ( const FaceUri uri,
ndn::nfd::FacePersistency  persistency,
const FaceCreatedCallback onCreated,
const FaceConnectFailedCallback onConnectFailed 
)
virtual

Try to create Face using the supplied FaceUri.

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

Exceptions
ErrorFactory does not support connect operation
Errorspecified persistency is not supported

Implements nfd::ProtocolFactory.

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

Referenced by nfd::WebSocketFactory::Error::Error().

std::list< shared_ptr< const Channel > > nfd::WebSocketFactory::getChannels ( ) const
virtual

Implements nfd::ProtocolFactory.

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

Referenced by nfd::WebSocketFactory::Error::Error().


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