22 #ifndef NDN_TCP_TRANSPORT_HPP
23 #define NDN_TCP_TRANSPORT_HPP
26 #include "../common.hpp"
27 #include "transport.hpp"
33 class DynamicUInt8Vector;
53 : host_(host), port_(port)
123 send(
const uint8_t *data,
size_t dataLength);
147 ptr_lib::shared_ptr<struct ndn_TcpTransport> transport_;
148 ptr_lib::shared_ptr<DynamicUInt8Vector> elementBuffer_;
150 ConnectionInfo connectionInfo_;
A Transport object is used by Face to send packets and to listen for incoming packets.
Definition: transport.hpp:36
const std::string & getHost() const
Get the host given to the constructor.
Definition: tcp-transport.hpp:62
An ElementListener extends an ndn_ElementListener struct to proved an abstract virtual onReceivedElem...
Definition: element-listener.hpp:33
virtual void processEvents()
Process any data to receive.
virtual void send(const uint8_t *data, size_t dataLength)
Send data to the host.
virtual bool isLocal(const Transport::ConnectionInfo &connectionInfo)
Determine whether this transport connecting according to connectionInfo is to a node on the current m...
A TcpTransport::ConnectionInfo extends Transport::ConnectionInfo to hold the host and port info for t...
Definition: tcp-transport.hpp:45
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:52
TcpTransport extends the Transport interface to implement communication over TCP. ...
Definition: tcp-transport.hpp:39
virtual void close()
Close the connection to the host.
A Transport::ConnectionInfo is a base class for connection information used by subclasses of Transpor...
Definition: transport.hpp:42
virtual bool isAsync()
Override to return false since connect does not need to use the onConnected callback.
virtual void connect(const Transport::ConnectionInfo &connectionInfo, ElementListener &elementListener, const OnConnected &onConnected)
Connect according to the info in ConnectionInfo, and processEvents() will use elementListener.
unsigned short getPort() const
Get the port given to the constructor.
Definition: tcp-transport.hpp:69