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
tcp-transport.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#ifndef NFD_DAEMON_FACE_TCP_TRANSPORT_HPP
27
#define NFD_DAEMON_FACE_TCP_TRANSPORT_HPP
28
29
#include "
stream-transport.hpp
"
30
#include "
core/scheduler.hpp
"
31
32
namespace
nfd
{
33
namespace
face
{
34
42
class
TcpTransport
FINAL_UNLESS_WITH_TESTS
:
public
StreamTransport
<boost::asio::ip::tcp>
43
{
44
public
:
45
TcpTransport
(
protocol::socket
&&
socket
,
ndn::nfd::FacePersistency
persistency);
46
47
protected
:
48
bool
49
canChangePersistencyToImpl
(
ndn::nfd::FacePersistency
newPersistency)
const
final
;
50
51
void
52
afterChangePersistency
(
ndn::nfd::FacePersistency
oldPersistency)
final
;
53
54
void
55
doClose
()
final
;
56
57
void
58
handleError
(
const
boost::system::error_code& error)
final
;
59
60
PROTECTED_WITH_TESTS_ELSE_PRIVATE
:
61
VIRTUAL_WITH_TESTS
void
62
reconnect();
63
64
VIRTUAL_WITH_TESTS
void
65
handleReconnect(
const
boost::system::error_code& error);
66
67
VIRTUAL_WITH_TESTS
void
68
handleReconnectTimeout();
69
70
PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
73
static
time::milliseconds
s_initialReconnectWait;
74
77
static
time::milliseconds
s_maxReconnectWait;
78
81
static
float
s_reconnectWaitMultiplier;
82
83
private
:
84
typename
protocol::endpoint m_remoteEndpoint;
85
88
scheduler::ScopedEventId
m_reconnectEvent;
89
92
time::milliseconds
m_nextReconnectWait;
93
};
94
95
}
// namespace face
96
}
// namespace nfd
97
98
#endif // NFD_DAEMON_FACE_TCP_TRANSPORT_HPP
PUBLIC_WITH_TESTS_ELSE_PRIVATE
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
Definition:
common.hpp:40
nfd::face::TcpTransport::afterChangePersistency
void afterChangePersistency(ndn::nfd::FacePersistency oldPersistency) final
invoked after the persistency has been changed
Definition:
tcp-transport.cpp:65
nfd::face::TcpTransport::doClose
void doClose() final
performs Transport specific operations to close the transport
Definition:
tcp-transport.cpp:164
nfd::face::TcpTransport::TcpTransport
TcpTransport(protocol::socket &&socket, ndn::nfd::FacePersistency persistency)
Definition:
tcp-transport.cpp:37
stream-transport.hpp
nfd::face::TcpTransport
A Transport that communicates on a connected TCP socket.
Definition:
tcp-transport.hpp:42
websocketpp::lib::asio::milliseconds
boost::posix_time::time_duration milliseconds(long duration)
Definition:
asio.hpp:117
VIRTUAL_WITH_TESTS
#define VIRTUAL_WITH_TESTS
Definition:
common.hpp:38
nfd::face::StreamTransport
Implements Transport for stream-based protocols.
Definition:
stream-transport.hpp:42
ndn::nfd::FacePersistency
FacePersistency
Definition:
nfd-constants.hpp:45
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
nfd::scheduler::ScopedEventId
cancels an event automatically upon destruction
Definition:
scheduler.hpp:59
face
nfd::face::TcpTransport::handleError
void handleError(const boost::system::error_code &error) final
Definition:
tcp-transport.cpp:78
scheduler.hpp
nfd::face::TcpTransport::canChangePersistencyToImpl
bool canChangePersistencyToImpl(ndn::nfd::FacePersistency newPersistency) const final
invoked by canChangePersistencyTo to perform the check
Definition:
tcp-transport.cpp:59
PROTECTED_WITH_TESTS_ELSE_PRIVATE
#define PROTECTED_WITH_TESTS_ELSE_PRIVATE
Definition:
common.hpp:41
websocketpp::transport::asio::socket::error::socket
Catch-all error for socket component errors that don't fit in other categories.
Definition:
base.hpp:83
FINAL_UNLESS_WITH_TESTS
#define FINAL_UNLESS_WITH_TESTS
Definition:
common.hpp:42
ndnSIM
NFD
daemon
face
tcp-transport.hpp
Generated on Thu Nov 2 2017 03:30:29 for ndnSIM by
1.8.11