blob: 8be6a736ed15bf48be63c2565f8b45c7c853bb0f [file] [log] [blame]
Jeff Thompsonfcf347d2013-07-15 11:30:44 -07001/**
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/TcpTransport.h"
Jeff Thompsonb002f902013-07-16 18:07:18 -070010#include "../c/encoding/BinaryXMLElementReader.h"
Jeff Thompsonfcf347d2013-07-15 11:30:44 -070011#include "Transport.hpp"
12
13namespace ndn {
14
15class TcpTransport : public Transport {
16public:
17 TcpTransport()
18 {
19 ndn_TcpTransport_init(&transport_);
Jeff Thompson0cb7aee2013-07-16 16:18:06 -070020 ndn_ = 0;
Jeff Thompsonfcf347d2013-07-15 11:30:44 -070021 }
22
Jeff Thompson0cb7aee2013-07-16 16:18:06 -070023 virtual void connect(NDN &ndn);
Jeff Thompsonfcf347d2013-07-15 11:30:44 -070024
25 virtual void send(unsigned char *data, unsigned int dataLength);
26
Jeff Thompson0cb7aee2013-07-16 16:18:06 -070027 virtual void tempReceive();
Jeff Thompsonfcf347d2013-07-15 11:30:44 -070028
29private:
30 struct ndn_TcpTransport transport_;
Jeff Thompson0cb7aee2013-07-16 16:18:06 -070031 NDN *ndn_;
Jeff Thompsonb002f902013-07-16 18:07:18 -070032 // TODO: This belongs in the socket listener.
33 ndn_BinaryXMLElementReader elementReader_;
Jeff Thompsonfcf347d2013-07-15 11:30:44 -070034};
35
36}
37
38#endif