NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
unix-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_UNIX_TRANSPORT_HPP
23
#define NDN_TRANSPORT_UNIX_TRANSPORT_HPP
24
25
#include "
transport.hpp
"
26
#include "../util/config-file.hpp"
27
28
#include <boost/asio/local/stream_protocol.hpp>
29
30
namespace
ndn
{
31
32
template
<
typename
BaseTransport,
typename
Protocol>
33
class
StreamTransportImpl;
34
37
class
UnixTransport
:
public
Transport
38
{
39
public
:
40
explicit
41
UnixTransport
(
const
std::string& unixSocket);
42
43
~UnixTransport
()
override
;
44
45
void
46
connect
(boost::asio::io_service& ioService,
47
const
ReceiveCallback
& receiveCallback)
override
;
48
49
void
50
close
()
override
;
51
52
void
53
pause
()
override
;
54
55
void
56
resume
()
override
;
57
58
void
59
send
(
const
Block
& wire)
override
;
60
61
void
62
send
(
const
Block
& header,
const
Block
& payload)
override
;
63
67
static
shared_ptr<UnixTransport>
68
create
(
const
std::string& uri);
69
70
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
71
static
std::string
72
getSocketNameFromUri(
const
std::string& uri);
73
74
private
:
75
std::string m_unixSocket;
76
77
using
Impl
=
StreamTransportImpl<UnixTransport, boost::asio::local::stream_protocol>
;
78
friend
Impl
;
79
shared_ptr<Impl> m_impl;
80
};
81
82
}
// namespace ndn
83
84
#endif // NDN_TRANSPORT_UNIX_TRANSPORT_HPP
ndn::UnixTransport
a transport using Unix stream socket
Definition:
unix-transport.hpp:37
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
Definition:
common.hpp:43
ndn::Block
Represents a TLV element of NDN packet format.
Definition:
block.hpp:42
transport.hpp
ndn::UnixTransport::send
void send(const Block &wire) override
send a TLV block through the transport
Definition:
unix-transport.cpp:92
ndn::StreamTransportImpl
implementation detail of a Boost.Asio-based stream-oriented transport
Definition:
stream-transport-impl.hpp:40
ndn::UnixTransport::create
static shared_ptr< UnixTransport > create(const std::string &uri)
Create transport with parameters defined in URI.
Definition:
unix-transport.cpp:71
ndn::UnixTransport::pause
void pause() override
pause the transport
Definition:
unix-transport.cpp:115
ndn::UnixTransport::resume
void resume() override
resume the transport
Definition:
unix-transport.cpp:124
ndn::UnixTransport::~UnixTransport
~UnixTransport() override
ndn::UnixTransport::close
void close() override
Close the connection.
Definition:
unix-transport.cpp:106
ndn::Transport
provides TLV-block delivery service
Definition:
transport.hpp:35
ndn::UnixTransport::connect
void connect(boost::asio::io_service &ioService, const ReceiveCallback &receiveCallback) override
asynchronously open the connection
Definition:
unix-transport.cpp:77
ndn::UnixTransport::UnixTransport
UnixTransport(const std::string &unixSocket)
Definition:
unix-transport.cpp:34
ndn::Transport::ReceiveCallback
function< void(const Block &wire)> ReceiveCallback
Definition:
transport.hpp:47
ndnSIM
ndn-cxx
src
transport
unix-transport.hpp
Generated on Sun Feb 25 2018 13:27:05 for ndnSIM by
1.8.14