NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
websocket-factory.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#ifndef NFD_DAEMON_FACE_WEBSOCKET_FACTORY_HPP
27
#define NFD_DAEMON_FACE_WEBSOCKET_FACTORY_HPP
28
29
#include "
protocol-factory.hpp
"
30
#include "
websocket-channel.hpp
"
31
32
namespace
nfd
{
33
34
class
WebSocketFactory
:
public
ProtocolFactory
35
{
36
public
:
40
class
Error
:
public
ProtocolFactory::Error
41
{
42
public
:
43
explicit
44
Error
(
const
std::string& what)
45
:
ProtocolFactory
::
Error
(what)
46
{
47
}
48
};
49
50
explicit
51
WebSocketFactory
(
const
std::string& defaultPort);
52
67
shared_ptr<WebSocketChannel>
68
createChannel
(
const
websocket::Endpoint
& localEndpoint);
69
78
shared_ptr<WebSocketChannel>
79
createChannel
(
const
std::string& localIp,
const
std::string& port);
80
81
// from ProtocolFactory
82
virtual
void
83
createFace
(
const
FaceUri
& uri,
84
ndn::nfd::FacePersistency
persistency,
85
const
FaceCreatedCallback
& onCreated,
86
const
FaceConnectFailedCallback
& onConnectFailed)
DECL_OVERRIDE
;
87
88
virtual
std::list<shared_ptr<const Channel> >
89
getChannels
()
const
;
90
91
private
:
100
shared_ptr<WebSocketChannel>
101
findChannel(
const
websocket::Endpoint
& localEndpoint);
102
103
typedef
std::map< websocket::Endpoint, shared_ptr<WebSocketChannel> > ChannelMap;
104
ChannelMap m_channels;
105
106
std::string m_defaultPort;
107
};
108
109
}
// namespace nfd
110
111
#endif // NFD_DAEMON_FACE_WEBSOCKET_FACTORY_HPP
nfd::FaceConnectFailedCallback
function< void(const std::string &reason)> FaceConnectFailedCallback
Prototype for the callback that is called when face is failed to get created.
Definition:
protocol-factory.hpp:47
ndn::util::FaceUri
represents the underlying protocol and address used by a Face
Definition:
face-uri.hpp:44
protocol-factory.hpp
nfd::WebSocketFactory::createChannel
shared_ptr< WebSocketChannel > createChannel(const websocket::Endpoint &localEndpoint)
Create WebSocket-based channel using websocket::Endpoint.
Definition:
websocket-factory.cpp:38
nfd::WebSocketFactory::Error
Exception of WebSocketFactory.
Definition:
websocket-factory.hpp:40
websocket-channel.hpp
DECL_OVERRIDE
#define DECL_OVERRIDE
expands to 'override' if compiler supports this feature, otherwise expands to nothing ...
Definition:
common.hpp:49
nfd::WebSocketFactory::Error::Error
Error(const std::string &what)
Definition:
websocket-factory.hpp:44
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:38
nfd::ProtocolFactory
Definition:
protocol-factory.hpp:50
nfd::WebSocketFactory::getChannels
virtual std::list< shared_ptr< const Channel > > getChannels() const
Definition:
websocket-factory.cpp:78
nfd::ProtocolFactory::Error
Base class for all exceptions thrown by channel factories.
Definition:
protocol-factory.hpp:56
ndn::nfd::FacePersistency
FacePersistency
Definition:
nfd-constants.hpp:48
nfd::WebSocketFactory::createFace
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.
Definition:
websocket-factory.cpp:69
nfd::WebSocketFactory::WebSocketFactory
WebSocketFactory(const std::string &defaultPort)
Definition:
websocket-factory.cpp:32
nfd::FaceCreatedCallback
function< void(const shared_ptr< Face > &newFace)> FaceCreatedCallback
Prototype for the callback called when face is created (as a response to incoming connection or after...
Definition:
protocol-factory.hpp:34
nfd::websocket::Endpoint
boost::asio::ip::tcp::endpoint Endpoint
Definition:
websocket-face.hpp:41
nfd::WebSocketFactory
Definition:
websocket-factory.hpp:34
ndnSIM
NFD
daemon
face
websocket-factory.hpp
Generated on Tue Feb 23 2016 22:18:44 for ndnSIM by
1.8.11