NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: 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; -*- */
22
#ifndef NDN_TRANSPORT_TCP_TRANSPORT_HPP
23
#define NDN_TRANSPORT_TCP_TRANSPORT_HPP
24
25
#include "../common.hpp"
26
#include "
transport.hpp
"
27
#include "../util/config-file.hpp"
28
29
30
// forward declaration
31
namespace
boost
{
namespace
asio {
namespace
ip {
class
tcp; } } }
32
33
namespace
ndn
{
34
35
// forward declaration
36
template
<
class
T,
class
U>
class
StreamTransportImpl;
37
template
<
class
T,
class
U>
class
StreamTransportWithResolverImpl;
38
39
class
TcpTransport
:
public
Transport
40
{
41
public
:
42
TcpTransport
(
const
std::string& host,
const
std::string& port =
"6363"
);
43
~TcpTransport
();
44
45
// from Transport
46
virtual
void
47
connect
(boost::asio::io_service& ioService,
48
const
ReceiveCallback
& receiveCallback);
49
50
virtual
void
51
close
();
52
53
virtual
void
54
pause
();
55
56
virtual
void
57
resume
();
58
59
virtual
void
60
send
(
const
Block
& wire);
61
62
virtual
void
63
send
(
const
Block
& header,
const
Block
& payload);
64
65
static
shared_ptr<TcpTransport>
66
create
(
const
ConfigFile
& config);
67
68
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
69
70
static
std::pair<std::string, std::string>
71
getDefaultSocketHostAndPort
(
const
ConfigFile
& config);
72
73
private
:
74
std::string m_host;
75
std::string m_port;
76
77
typedef
StreamTransportWithResolverImpl<TcpTransport, boost::asio::ip::tcp>
Impl
;
78
friend
class
StreamTransportImpl
<
TcpTransport
,
boost
::asio::ip::tcp>;
79
friend class
StreamTransportWithResolverImpl
<TcpTransport, boost::asio::ip::tcp>;
80
shared_ptr< Impl > m_impl;
81
};
82
83
}
// namespace ndn
84
85
#endif // NDN_TRANSPORT_TCP_TRANSPORT_HPP
ndn::TcpTransport::resume
virtual void resume()
Definition:
tcp-transport.cpp:124
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
boost
Copyright (c) 2013-2015 Regents of the University of California.
Definition:
ndn-content-store.hpp:209
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
Definition:
common.hpp:43
ndn::TcpTransport::create
static shared_ptr< TcpTransport > create(const ConfigFile &config)
Definition:
tcp-transport.cpp:41
ndn::TcpTransport::pause
virtual void pause()
Definition:
tcp-transport.cpp:116
ndn::Block
Class representing a wire element of NDN-TLV packet format.
Definition:
block.hpp:43
ndn::TcpTransport::connect
virtual void connect(boost::asio::io_service &ioService, const ReceiveCallback &receiveCallback)
Connect transport.
Definition:
tcp-transport.cpp:80
ndn::TcpTransport
Definition:
tcp-transport.hpp:39
ndn::StreamTransportImpl
Definition:
stream-transport.hpp:32
ndn::TcpTransport::send
virtual void send(const Block &wire)
Send block of data from.
Definition:
tcp-transport.cpp:94
ndn::Transport::ReceiveCallback
function< void(const Block &wire)> ReceiveCallback
Definition:
transport.hpp:42
ndn::TcpTransport::close
virtual void close()
Close the connection.
Definition:
tcp-transport.cpp:108
ndn::StreamTransportWithResolverImpl
Definition:
stream-transport.hpp:288
ndn::Transport
Definition:
transport.hpp:32
ndn::ConfigFile
Definition:
config-file.hpp:34
ndn::TcpTransport::~TcpTransport
~TcpTransport()
Definition:
tcp-transport.cpp:36
ndn::TcpTransport::TcpTransport
TcpTransport(const std::string &host, const std::string &port="6363")
Definition:
tcp-transport.cpp:30
transport.hpp
ndn::TcpTransport::getDefaultSocketHostAndPort
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE std::string getDefaultSocketHostAndPort(const ConfigFile &config)
Definition:
tcp-transport.cpp:48
ndnSIM
ndn-cxx
src
transport
tcp-transport.hpp
Generated on Fri Feb 23 2018 12:30:55 for ndnSIM by
1.8.14