blob: 460eeddaf4680c47a2d0b1db0b34cb12ce66d0f0 [file] [log] [blame]
Jeff Thompsonbc53c522013-07-17 17:11:48 -07001/**
2 * @author: Jeff Thompson
3 * See COPYING for copyright and distribution information.
4 */
5
Jeff Thompson95a71b12013-07-31 10:49:50 -07006#ifndef NDN_UDPTRANSPORT_HPP
7#define NDN_UDPTRANSPORT_HPP
Jeff Thompsonbc53c522013-07-17 17:11:48 -07008
9#include "../c/transport/UdpTransport.h"
10#include "../c/encoding/BinaryXMLElementReader.h"
11#include "Transport.hpp"
12
13namespace ndn {
14
15class UdpTransport : public Transport {
16public:
17 UdpTransport()
18 {
19 ndn_UdpTransport_init(&transport_);
20 ndn_ = 0;
21 }
22
23 /**
24 *
25 * @param ndn Not a shared_ptr because we assume that it will remain valid during the life of this Transport object.
26 */
27 virtual void connect(NDN &ndn);
28
Jeff Thompson60eaae32013-07-30 15:46:19 -070029 virtual void send(const unsigned char *data, unsigned int dataLength);
Jeff Thompsonbc53c522013-07-17 17:11:48 -070030
31 virtual void tempReceive();
32
33private:
34 struct ndn_UdpTransport transport_;
35 NDN *ndn_;
36 // TODO: This belongs in the socket listener.
Jeff Thompsonf0fea002013-07-30 17:22:42 -070037 ndn_BinaryXmlElementReader elementReader_;
Jeff Thompsonbc53c522013-07-17 17:11:48 -070038};
39
40}
41
42#endif