blob: c2ba56e24b1a0edfa7ddd9be9dee48857a996b23 [file] [log] [blame]
Alexander Afanasyev20d2c582014-01-26 15:32:51 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/**
3 * Copyright (C) 2013 Regents of the University of California.
4 * @author: Jeff Thompson <jefft0@remap.ucla.edu>
5 * See COPYING for copyright and distribution information.
6 */
7
8#ifndef NDN_TCP_TRANSPORT_HPP
9#define NDN_TCP_TRANSPORT_HPP
10
Alexander Afanasyeve2dcdfd2014-02-07 15:53:28 -080011#include "../common.hpp"
Alexander Afanasyev20d2c582014-01-26 15:32:51 -080012#include "transport.hpp"
13
14namespace ndn {
15
16class TcpTransport : public Transport
17{
18public:
19 TcpTransport(const std::string& host, const std::string& port = "6363");
20 ~TcpTransport();
21
22 // from Transport
23 virtual void
24 connect(boost::asio::io_service &ioService,
25 const ReceiveCallback &receiveCallback);
26
27 virtual void
28 close();
29
30 virtual void
31 send(const Block &wire);
32
33private:
34 std::string host_;
35 std::string port_;
36
37 class Impl;
38 ptr_lib::shared_ptr<Impl> impl_;
39};
40
41}
42
43#endif // NDN_TCP_TRANSPORT_HPP