Alexander Afanasyev | 20d2c58 | 2014-01-26 15:32:51 -0800 | [diff] [blame] | 1 | /* -*- 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 Afanasyev | e2dcdfd | 2014-02-07 15:53:28 -0800 | [diff] [blame] | 11 | #include "../common.hpp" |
Alexander Afanasyev | 20d2c58 | 2014-01-26 15:32:51 -0800 | [diff] [blame] | 12 | #include "transport.hpp" |
| 13 | |
| 14 | namespace ndn { |
| 15 | |
| 16 | class TcpTransport : public Transport |
| 17 | { |
| 18 | public: |
| 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 | |
| 33 | private: |
| 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 |