NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
+
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
+
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
p
q
r
s
t
u
v
w
+
Typedefs
a
b
c
d
e
f
h
i
k
l
n
o
p
q
r
s
t
u
v
+
Enumerations
a
b
c
d
f
i
k
l
n
p
q
r
s
t
u
+
Enumerator
a
b
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
t
u
v
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
+
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
~
+
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
+
Enumerator
a
c
d
e
i
k
l
m
n
p
r
s
u
w
+
Related Functions
b
c
d
e
f
g
i
k
l
m
n
o
p
s
v
+
Files
File List
+
File Members
+
All
a
c
d
e
f
g
h
i
k
l
m
n
p
r
s
t
u
v
w
+
Functions
c
f
h
m
r
s
u
w
+
Variables
a
c
d
f
g
i
k
l
n
p
r
s
t
u
Typedefs
+
Macros
d
e
f
i
l
m
n
p
r
s
u
v
•
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; -*- */
2
/*
3
* Copyright (c) 2013-2017 Regents of the University of California.
4
*
5
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6
*
7
* ndn-cxx library is free software: you can redistribute it and/or modify it under the
8
* terms of the GNU Lesser General Public License as published by the Free Software
9
* Foundation, either version 3 of the License, or (at your option) any later version.
10
*
11
* ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14
*
15
* You should have received copies of the GNU General Public License and GNU Lesser
16
* General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17
* <http://www.gnu.org/licenses/>.
18
*
19
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
20
*/
21
22
#ifndef NDN_TRANSPORT_TCP_TRANSPORT_HPP
23
#define NDN_TRANSPORT_TCP_TRANSPORT_HPP
24
25
#include "
transport.hpp
"
26
#include "../util/config-file.hpp"
27
28
#include <boost/asio/ip/tcp.hpp>
29
30
namespace
ndn
{
31
32
template
<
typename
BaseTransport,
typename
Protocol>
33
class
StreamTransportImpl;
34
35
template
<
typename
BaseTransport,
typename
Protocol>
36
class
StreamTransportWithResolverImpl;
37
40
class
TcpTransport
:
public
Transport
41
{
42
public
:
43
explicit
44
TcpTransport
(
const
std::string& host,
const
std::string& port =
"6363"
);
45
46
~TcpTransport
()
override
;
47
48
void
49
connect
(boost::asio::io_service& ioService,
const
ReceiveCallback
& receiveCallback)
override
;
50
51
void
52
close
()
override
;
53
54
void
55
pause
()
override
;
56
57
void
58
resume
()
override
;
59
60
void
61
send
(
const
Block
& wire)
override
;
62
63
void
64
send
(
const
Block
& header,
const
Block
& payload)
override
;
65
69
static
shared_ptr<TcpTransport>
70
create
(
const
std::string& uri);
71
72
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
73
static
std::pair<std::string, std::string>
74
getSocketHostAndPortFromUri
(
const
std::string& uri);
75
76
private
:
77
std::string m_host;
78
std::string m_port;
79
80
using
Impl
=
StreamTransportWithResolverImpl<TcpTransport, boost::asio::ip::tcp>
;
81
friend
class
StreamTransportImpl
<
TcpTransport
,
boost
::asio::ip::tcp>;
82
friend
Impl
;
83
shared_ptr<Impl> m_impl;
84
};
85
86
}
// namespace ndn
87
88
#endif // NDN_TRANSPORT_TCP_TRANSPORT_HPP
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::TcpTransport::resume
void resume() override
resume the transport
Definition:
tcp-transport.cpp:129
boost
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::connect
void connect(boost::asio::io_service &ioService, const ReceiveCallback &receiveCallback) override
asynchronously open the connection
Definition:
tcp-transport.cpp:81
ndn::Block
Represents a TLV element of NDN packet format.
Definition:
block.hpp:42
transport.hpp
ndn::TcpTransport
a transport using TCP socket
Definition:
tcp-transport.hpp:40
ndn::StreamTransportImpl
implementation detail of a Boost.Asio-based stream-oriented transport
Definition:
stream-transport-impl.hpp:40
ndn::TcpTransport::send
void send(const Block &wire) override
send a TLV block through the transport
Definition:
tcp-transport.cpp:97
ndn::TcpTransport::getSocketHostAndPortFromUri
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE std::string getSocketHostAndPortFromUri(const std::string &uri)
Definition:
tcp-transport.cpp:48
ndn::TcpTransport::create
static shared_ptr< TcpTransport > create(const std::string &uri)
Create transport with parameters defined in URI.
Definition:
tcp-transport.cpp:41
ndn::StreamTransportWithResolverImpl
implementation detail of a Boost.Asio-based stream-oriented transport with resolver support ...
Definition:
stream-transport-with-resolver-impl.hpp:33
ndn::Transport
provides TLV-block delivery service
Definition:
transport.hpp:35
ndn::TcpTransport::close
void close() override
Close the connection.
Definition:
tcp-transport.cpp:111
ndn::TcpTransport::TcpTransport
TcpTransport(const std::string &host, const std::string &port="6363")
Definition:
tcp-transport.cpp:32
ndn::TcpTransport::pause
void pause() override
pause the transport
Definition:
tcp-transport.cpp:120
ndn::Transport::ReceiveCallback
function< void(const Block &wire)> ReceiveCallback
Definition:
transport.hpp:47
ndn::TcpTransport::~TcpTransport
~TcpTransport() override
ndnSIM
ndn-cxx
src
transport
tcp-transport.hpp
Generated on Sun Feb 25 2018 13:27:06 for ndnSIM by
1.8.14