NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
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
void
49
beforeChangePersistency
(
ndn::nfd::FacePersistency
newPersistency)
final
;
50
51
void
52
doClose
()
final
;
53
54
void
55
handleError
(
const
boost::system::error_code& error)
final
;
56
57
PROTECTED_WITH_TESTS_ELSE_PRIVATE
:
58
VIRTUAL_WITH_TESTS
void
59
reconnect();
60
61
VIRTUAL_WITH_TESTS
void
62
handleReconnect(
const
boost::system::error_code& error);
63
64
VIRTUAL_WITH_TESTS
void
65
handleReconnectTimeout();
66
67
PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
70
static
time::milliseconds s_initialReconnectWait;
71
74
static
time::milliseconds s_maxReconnectWait;
75
78
static
float
s_reconnectWaitMultiplier;
79
80
private
:
81
typename
protocol::endpoint m_remoteEndpoint;
82
85
scheduler::ScopedEventId
m_reconnectEvent;
86
89
time::milliseconds m_nextReconnectWait;
90
};
91
92
}
// namespace face
93
}
// namespace nfd
94
95
#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::doClose
void doClose() final
performs Transport specific operations to close the transport
Definition:
tcp-transport.cpp:158
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
VIRTUAL_WITH_TESTS
#define VIRTUAL_WITH_TESTS
Copyright (c) 2014-2016, Regents of the University of California, Arizona Board of Regents...
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:49
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:57
face
nfd::face::TcpTransport::handleError
void handleError(const boost::system::error_code &error) final
Definition:
tcp-transport.cpp:72
nfd::face::TcpTransport::beforeChangePersistency
void beforeChangePersistency(ndn::nfd::FacePersistency newPersistency) final
invoked before persistency is changed
Definition:
tcp-transport.cpp:59
scheduler.hpp
PROTECTED_WITH_TESTS_ELSE_PRIVATE
#define PROTECTED_WITH_TESTS_ELSE_PRIVATE
Definition:
common.hpp:41
FINAL_UNLESS_WITH_TESTS
#define FINAL_UNLESS_WITH_TESTS
Definition:
common.hpp:42
ndnSIM
NFD
daemon
face
tcp-transport.hpp
Generated on Wed Jan 11 2017 18:17:15 for ndnSIM by
1.8.13