NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
ndnSIM
ndnSIM documentation
All Attributes
All GlobalValues
All LogComponents
All TraceSources
Todo List
Deprecated List
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
unix-stream-channel.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#ifndef NFD_DAEMON_FACE_UNIX_STREAM_CHANNEL_HPP
27
#define NFD_DAEMON_FACE_UNIX_STREAM_CHANNEL_HPP
28
29
#include "
channel.hpp
"
30
31
namespace
nfd
{
32
33
namespace
unix_stream {
34
typedef
boost::asio::local::stream_protocol::endpoint
Endpoint
;
35
}
// namespace unix_stream
36
37
namespace
face
{
38
45
class
UnixStreamChannel
:
public
Channel
46
{
47
public
:
51
class
Error
:
public
std::runtime_error
52
{
53
public
:
54
explicit
55
Error
(
const
std::string& what)
56
:
std
::runtime_error(what)
57
{
58
}
59
};
60
67
explicit
68
UnixStreamChannel
(
const
unix_stream::Endpoint
& endpoint);
69
70
~
UnixStreamChannel
()
override
;
71
72
bool
73
isListening
()
const override
74
{
75
return
m_acceptor.is_open();
76
}
77
78
size_t
79
size
()
const override
80
{
81
return
m_size;
82
}
83
99
void
100
listen(
const
FaceCreatedCallback
& onFaceCreated,
101
const
FaceCreationFailedCallback
& onAcceptFailed,
102
int
backlog = boost::asio::local::stream_protocol::acceptor::max_connections);
103
104
private
:
105
void
106
accept
(
const
FaceCreatedCallback
& onFaceCreated,
107
const
FaceCreationFailedCallback
& onAcceptFailed);
108
109
void
110
handleAccept(
const
boost::system::error_code& error,
111
const
FaceCreatedCallback
& onFaceCreated,
112
const
FaceCreationFailedCallback
& onAcceptFailed);
113
114
private
:
115
const
unix_stream::Endpoint
m_endpoint;
116
boost::asio::local::stream_protocol::acceptor m_acceptor;
117
boost::asio::local::stream_protocol::socket
m_socket;
118
size_t
m_size;
119
};
120
121
}
// namespace face
122
}
// namespace nfd
123
124
#endif // NFD_DAEMON_FACE_UNIX_STREAM_CHANNEL_HPP
nfd::face::Channel
represent a channel that communicates on a local endpoint
Definition:
channel.hpp:52
nfd::face::UnixStreamChannel::size
size_t size() const override
Returns the number of faces in the channel.
Definition:
unix-stream-channel.hpp:79
websocketpp::extensions::permessage_deflate::mode::accept
Accept any value the remote endpoint offers.
Definition:
enabled.hpp:194
channel.hpp
std
STL namespace.
nfd::face::UnixStreamChannel::Error
UnixStreamChannel-related error.
Definition:
unix-stream-channel.hpp:51
nfd::face::UnixStreamChannel::Error::Error
Error(const std::string &what)
Definition:
unix-stream-channel.hpp:55
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
nfd::face::UnixStreamChannel
Class implementing a local channel to create faces.
Definition:
unix-stream-channel.hpp:45
face
nfd::face::FaceCreationFailedCallback
function< void(uint32_t status, const std::string &reason)> FaceCreationFailedCallback
Prototype for the callback that is invoked when a face fails to be created.
Definition:
channel.hpp:44
nfd::face::UnixStreamChannel::isListening
bool isListening() const override
Returns whether the channel is listening.
Definition:
unix-stream-channel.hpp:73
nfd::unix_stream::Endpoint
boost::asio::local::stream_protocol::endpoint Endpoint
Definition:
unix-stream-channel.hpp:34
websocketpp::transport::asio::socket::error::socket
Catch-all error for socket component errors that don't fit in other categories.
Definition:
base.hpp:83
nfd::face::UnixStreamChannel
UnixStreamChannel
Definition:
unix-stream-channel.cpp:37
nfd::face::FaceCreatedCallback
function< void(const shared_ptr< Face > &newFace)> FaceCreatedCallback
Prototype for the callback that is invoked when a face is created (in response to an incoming connect...
Definition:
channel.hpp:35
ndnSIM
NFD
daemon
face
unix-stream-channel.hpp
Generated on Thu Nov 2 2017 03:30:29 for ndnSIM by
1.8.11