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
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
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::Block
Class representing a wire element of NDN-TLV packet format.
Definition:
block.hpp:43
ndn::TcpTransport
Definition:
tcp-transport.hpp:39
ndn::StreamTransportImpl
Definition:
stream-transport.hpp:32
ndn::Transport::ReceiveCallback
function< void(const Block &wire)> ReceiveCallback
Definition:
transport.hpp:42
ndn::StreamTransportWithResolverImpl
Definition:
stream-transport.hpp:288
ndn::Transport
Definition:
transport.hpp:32
ndn::ConfigFile
Definition:
config-file.hpp:34
transport.hpp
ndnSIM
ndn-cxx
src
transport
tcp-transport.hpp
Generated on Tue Feb 23 2016 22:18:44 for ndnSIM by
1.8.11