22 #ifndef NDN_TCP_TRANSPORT_HPP
23 #define NDN_TCP_TRANSPORT_HPP
26 #include "../common.hpp"
27 #include "transport.hpp"
33 class DynamicUInt8Vector;
49 : host_(host), port_(port)
107 virtual void send(
const uint8_t *data,
size_t dataLength);
120 virtual bool getIsConnected();
125 virtual void close();
128 ptr_lib::shared_ptr<struct ndn_TcpTransport> transport_;
129 ptr_lib::shared_ptr<DynamicUInt8Vector> elementBuffer_;
131 ConnectionInfo connectionInfo_;
virtual void close()
Close the connection to the host.
Definition: tcp-transport.cpp:109
Definition: transport.hpp:32
Copyright (C) 2013-2015 Regents of the University of California.
Definition: common.hpp:35
const std::string & getHost() const
Get the host given to the constructor.
Definition: tcp-transport.hpp:58
An ElementListener extends an ndn_ElementListener struct to proved an abstract virtual onReceivedElem...
Definition: element-listener.hpp:33
virtual bool isLocal(const Transport::ConnectionInfo &connectionInfo)
Determine whether this transport connecting according to connectionInfo is to a node on the current m...
Definition: tcp-transport.cpp:46
virtual void send(const uint8_t *data, size_t dataLength)
Set data to the host.
Definition: tcp-transport.cpp:85
virtual void connect(const Transport::ConnectionInfo &connectionInfo, ElementListener &elementListener)
Connect according to the info in ConnectionInfo, and processEvents() will use elementListener.
Definition: tcp-transport.cpp:69
virtual void processEvents()
Process any data to receive.
Definition: tcp-transport.cpp:93
A TcpTransport::ConnectionInfo extends Transport::ConnectionInfo to hold the host and port info for t...
Definition: tcp-transport.hpp:41
Definition: transport-types.h:35
ConnectionInfo(const char *host, unsigned short port=6363)
Create a ConnectionInfo with the given host and port.
Definition: tcp-transport.hpp:48
Definition: tcp-transport.hpp:35
A Transport::ConnectionInfo is a base class for connection information used by subclasses of Transpor...
Definition: transport.hpp:38
unsigned short getPort() const
Get the port given to the constructor.
Definition: tcp-transport.hpp:65