blob: cc97c21153971329dbfaa4513326f57b3f99a7fb [file] [log] [blame]
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +01001/* -*- 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 Afanasyevc78b1412014-02-19 14:08:26 -080012#ifndef HAVE_UNIX_SOCKETS
13#error "Cannot include this file when UNIX sockets are not available"
14#endif
15
Davide Pesaventobc4dd8c2014-02-14 20:01:01 +010016namespace nfd
17{
18
19/**
20 * \brief Implementation of Face abstraction that uses stream-oriented
21 * Unix domain sockets as underlying transport mechanism
22 */
23class UnixStreamFace : public StreamFace<boost::asio::local::stream_protocol>
24{
25public:
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