NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::TcpTransport Class Reference

#include <tcp-transport.hpp>

Inheritance diagram for ndn::TcpTransport:
Collaboration diagram for ndn::TcpTransport:

Public Member Functions

 TcpTransport (const std::string &host, const std::string &port="6363")
 
 ~TcpTransport ()
 
virtual void connect (boost::asio::io_service &ioService, const ReceiveCallback &receiveCallback)
 Connect transport. More...
 
virtual void close ()
 Close the connection. More...
 
virtual void pause ()
 
virtual void resume ()
 
virtual void send (const Block &wire)
 Send block of data from wire through the transport. More...
 
virtual void send (const Block &header, const Block &payload)
 Alternative version of sending data, applying scatter/gather I/O concept. More...
 
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE std::string getDefaultSocketHostAndPort (const ConfigFile &config)
 
- Public Member Functions inherited from ndn::Transport
 Transport ()
 
virtual ~Transport ()
 
bool isConnected ()
 
bool isExpectingData ()
 

Static Public Member Functions

static shared_ptr< TcpTransportcreate (const ConfigFile &config)
 

Public Attributes

NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE __pad0__: static std::pair<std::string
 

Friends

class StreamTransportImpl< TcpTransport, boost::asio::ip::tcp >
 
class StreamTransportWithResolverImpl< TcpTransport, boost::asio::ip::tcp >
 

Additional Inherited Members

- Public Types inherited from ndn::Transport
typedef function< void(const Block &wire)> ReceiveCallback
 
typedef function< void()> ErrorCallback
 
- Protected Member Functions inherited from ndn::Transport
void receive (const Block &wire)
 
- Protected Attributes inherited from ndn::Transport
boost::asio::io_service * m_ioService
 
bool m_isConnected
 
bool m_isExpectingData
 
ReceiveCallback m_receiveCallback
 

Detailed Description

Definition at line 39 of file tcp-transport.hpp.

Constructor & Destructor Documentation

§ TcpTransport()

ndn::TcpTransport::TcpTransport ( const std::string &  host,
const std::string &  port = "6363" 
)

§ ~TcpTransport()

ndn::TcpTransport::~TcpTransport ( )

Definition at line 36 of file tcp-transport.cpp.

Member Function Documentation

§ connect()

void ndn::TcpTransport::connect ( boost::asio::io_service &  io_service,
const ReceiveCallback receiveCallback 
)
virtual

Connect transport.

Exceptions
boost::system::system_errorif connection cannot be established

Reimplemented from ndn::Transport.

Definition at line 80 of file tcp-transport.cpp.

References ndn::Transport::connect().

§ close()

void ndn::TcpTransport::close ( )
virtual

Close the connection.

Implements ndn::Transport.

Definition at line 108 of file tcp-transport.cpp.

§ pause()

void ndn::TcpTransport::pause ( )
virtual

Implements ndn::Transport.

Definition at line 116 of file tcp-transport.cpp.

§ resume()

void ndn::TcpTransport::resume ( )
virtual

Implements ndn::Transport.

Definition at line 124 of file tcp-transport.cpp.

§ send() [1/2]

void ndn::TcpTransport::send ( const Block wire)
virtual

Send block of data from wire through the transport.

Parameters
wireA block of data to send

Implements ndn::Transport.

Definition at line 94 of file tcp-transport.cpp.

§ send() [2/2]

void ndn::TcpTransport::send ( const Block header,
const Block payload 
)
virtual

Alternative version of sending data, applying scatter/gather I/O concept.

Two non-consecutive memory blocks will be send out together, e.g., as part of the same message in datagram-oriented transports.

Implements ndn::Transport.

Definition at line 101 of file tcp-transport.cpp.

§ create()

shared_ptr< TcpTransport > ndn::TcpTransport::create ( const ConfigFile config)
static

Definition at line 41 of file tcp-transport.cpp.

References getDefaultSocketHostAndPort().

§ getDefaultSocketHostAndPort()

std::pair< std::string, std::string > ndn::TcpTransport::getDefaultSocketHostAndPort ( const ConfigFile config)

Friends And Related Function Documentation

§ StreamTransportImpl< TcpTransport, boost::asio::ip::tcp >

friend class StreamTransportImpl< TcpTransport, boost::asio::ip::tcp >
friend

Definition at line 78 of file tcp-transport.hpp.

§ StreamTransportWithResolverImpl< TcpTransport, boost::asio::ip::tcp >

friend class StreamTransportWithResolverImpl< TcpTransport, boost::asio::ip::tcp >
friend

Definition at line 79 of file tcp-transport.hpp.

Member Data Documentation

§ __pad0__

NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE ndn::TcpTransport::__pad0__

Definition at line 70 of file tcp-transport.hpp.


The documentation for this class was generated from the following files: