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 | |
| 12 | namespace nfd |
| 13 | { |
| 14 | |
| 15 | /** |
| 16 | * \brief Implementation of Face abstraction that uses stream-oriented |
| 17 | * Unix domain sockets as underlying transport mechanism |
| 18 | */ |
| 19 | class UnixStreamFace : public StreamFace<boost::asio::local::stream_protocol> |
| 20 | { |
| 21 | public: |
| 22 | typedef boost::asio::local::stream_protocol protocol; |
| 23 | |
| 24 | explicit |
| 25 | UnixStreamFace(const shared_ptr<protocol::socket>& socket); |
| 26 | |
| 27 | /** \brief Get whether face is connected to a local app |
| 28 | * |
| 29 | * Always true for a UnixStreamFace. |
| 30 | */ |
| 31 | virtual bool |
| 32 | isLocal() const; |
| 33 | }; |
| 34 | |
| 35 | } // namespace nfd |
| 36 | |
| 37 | #endif // NFD_FACE_UNIX_STREAM_FACE_HPP |