22 #ifndef NDN_UDPTRANSPORT_HPP
23 #define NDN_UDPTRANSPORT_HPP
26 #include "../common.hpp"
27 #include "transport.hpp"
33 class DynamicUInt8Vector;
49 : host_(host), port_(port)
113 send(
const uint8_t *data,
size_t dataLength);
137 ptr_lib::shared_ptr<struct ndn_UdpTransport> transport_;
138 ptr_lib::shared_ptr<DynamicUInt8Vector> elementBuffer_;
Definition: transport.hpp:32
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
const std::string & getHost() const
Get the host given to the constructor.
Definition: udp-transport.hpp:58
A UdpTransport::ConnectionInfo extends Transport::ConnectionInfo to hold the host and port info for t...
Definition: udp-transport.hpp:41
An ElementListener extends an ndn_ElementListener struct to proved an abstract virtual onReceivedElem...
Definition: element-listener.hpp:33
ConnectionInfo(const char *host, unsigned short port=6363)
Create a ConnectionInfo with the given host and port.
Definition: udp-transport.hpp:48
Definition: udp-transport.hpp:35
virtual void close()
Close the connection to the host.
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...
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: udp-transport.hpp:65
virtual void processEvents()
Process any data to receive.
A Transport::ConnectionInfo is a base class for connection information used by subclasses of Transpor...
Definition: transport.hpp:38
Definition: transport-types.h:39
virtual bool isAsync()
Override to return false since connect does not need to use the onConnected callback.