Jeff Thompson | bc53c52 | 2013-07-17 17:11:48 -0700 | [diff] [blame] | 1 | /** |
| 2 | * @author: Jeff Thompson |
| 3 | * See COPYING for copyright and distribution information. |
| 4 | */ |
| 5 | |
| 6 | #ifndef NDN_TCPTRANSPORT_HPP |
| 7 | #define NDN_TCPTRANSPORT_HPP |
| 8 | |
| 9 | #include "../c/transport/UdpTransport.h" |
| 10 | #include "../c/encoding/BinaryXMLElementReader.h" |
| 11 | #include "Transport.hpp" |
| 12 | |
| 13 | namespace ndn { |
| 14 | |
| 15 | class UdpTransport : public Transport { |
| 16 | public: |
| 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 Thompson | 60eaae3 | 2013-07-30 15:46:19 -0700 | [diff] [blame] | 29 | virtual void send(const unsigned char *data, unsigned int dataLength); |
Jeff Thompson | bc53c52 | 2013-07-17 17:11:48 -0700 | [diff] [blame] | 30 | |
| 31 | virtual void tempReceive(); |
| 32 | |
| 33 | private: |
| 34 | struct ndn_UdpTransport transport_; |
| 35 | NDN *ndn_; |
| 36 | // TODO: This belongs in the socket listener. |
| 37 | ndn_BinaryXMLElementReader elementReader_; |
| 38 | }; |
| 39 | |
| 40 | } |
| 41 | |
| 42 | #endif |