blob: c2ee20420f34995ba9cc1dc7e5555515835782b3 [file] [log] [blame]
Alexander Afanasyevfe3b1502013-12-18 16:45:03 -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_UDPTRANSPORT_HPP
9#define NDN_UDPTRANSPORT_HPP
10
11#include <string>
12#include "transport.hpp"
13
14namespace ndn {
15
Alexander Afanasyeve2e0d752014-01-03 13:30:30 -080016class UnixTransport : public Transport
17{
Alexander Afanasyevfe3b1502013-12-18 16:45:03 -080018public:
19 UnixTransport(const std::string &unixSocket = "/tmp/.ndnd.sock");
20 ~UnixTransport();
21
Alexander Afanasyeve2e0d752014-01-03 13:30:30 -080022 // from Transport
Alexander Afanasyevfe3b1502013-12-18 16:45:03 -080023 virtual void
Alexander Afanasyeva557d5a2013-12-28 21:59:03 -080024 connect(boost::asio::io_service &ioService,
Alexander Afanasyev3ae2da22013-12-29 15:50:04 -080025 const ReceiveCallback &receiveCallback);
Alexander Afanasyevfe3b1502013-12-18 16:45:03 -080026
Alexander Afanasyevfe3b1502013-12-18 16:45:03 -080027 virtual void
28 close();
Alexander Afanasyeve2e0d752014-01-03 13:30:30 -080029
30 virtual void
31 send(const Block &wire);
Alexander Afanasyevfe3b1502013-12-18 16:45:03 -080032
33private:
34 std::string unixSocket_;
Alexander Afanasyevfe3b1502013-12-18 16:45:03 -080035
36 class Impl;
Alexander Afanasyev50ca6272014-01-09 23:23:54 -080037 ptr_lib::shared_ptr<Impl> impl_;
Alexander Afanasyevfe3b1502013-12-18 16:45:03 -080038};
39
40}
41
42#endif