Davide Pesavento | bc4dd8c | 2014-02-14 20:01:01 +0100 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
| 3 | * Copyright (C) 2014 Named Data Networking Project |
| 4 | * See COPYING for copyright and distribution information. |
| 5 | */ |
| 6 | |
| 7 | #ifndef NFD_FACE_UNIX_STREAM_FACE_HPP |
| 8 | #define NFD_FACE_UNIX_STREAM_FACE_HPP |
| 9 | |
| 10 | #include "stream-face.hpp" |
| 11 | |
Alexander Afanasyev | c78b141 | 2014-02-19 14:08:26 -0800 | [diff] [blame] | 12 | #ifndef HAVE_UNIX_SOCKETS |
| 13 | #error "Cannot include this file when UNIX sockets are not available" |
| 14 | #endif |
| 15 | |
Davide Pesavento | bc4dd8c | 2014-02-14 20:01:01 +0100 | [diff] [blame] | 16 | namespace nfd |
| 17 | { |
| 18 | |
| 19 | /** |
| 20 | * \brief Implementation of Face abstraction that uses stream-oriented |
| 21 | * Unix domain sockets as underlying transport mechanism |
| 22 | */ |
| 23 | class UnixStreamFace : public StreamFace<boost::asio::local::stream_protocol> |
| 24 | { |
| 25 | public: |
| 26 | typedef boost::asio::local::stream_protocol protocol; |
| 27 | |
| 28 | explicit |
| 29 | UnixStreamFace(const shared_ptr<protocol::socket>& socket); |
| 30 | |
| 31 | /** \brief Get whether face is connected to a local app |
| 32 | * |
| 33 | * Always true for a UnixStreamFace. |
| 34 | */ |
| 35 | virtual bool |
| 36 | isLocal() const; |
| 37 | }; |
| 38 | |
| 39 | } // namespace nfd |
| 40 | |
| 41 | #endif // NFD_FACE_UNIX_STREAM_FACE_HPP |