Alexander Afanasyev | c169a81 | 2014-05-20 20:37:29 -0400 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 2 | /** |
Junxiao Shi | 446de3c | 2016-07-25 22:38:16 +0000 | [diff] [blame] | 3 | * Copyright (c) 2013-2016 Regents of the University of California. |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 4 | * |
| 5 | * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 6 | * |
Alexander Afanasyev | c169a81 | 2014-05-20 20:37:29 -0400 | [diff] [blame] | 7 | * ndn-cxx library is free software: you can redistribute it and/or modify it under the |
| 8 | * terms of the GNU Lesser General Public License as published by the Free Software |
| 9 | * Foundation, either version 3 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY |
| 12 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
| 13 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
| 14 | * |
| 15 | * You should have received copies of the GNU General Public License and GNU Lesser |
| 16 | * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see |
| 17 | * <http://www.gnu.org/licenses/>. |
| 18 | * |
| 19 | * See AUTHORS.md for complete list of ndn-cxx authors and contributors. |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 20 | */ |
| 21 | |
| 22 | #ifndef NDN_DETAIL_FACE_IMPL_HPP |
| 23 | #define NDN_DETAIL_FACE_IMPL_HPP |
| 24 | |
| 25 | #include "../common.hpp" |
| 26 | #include "../face.hpp" |
| 27 | |
| 28 | #include "registered-prefix.hpp" |
| 29 | #include "pending-interest.hpp" |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 30 | #include "container-with-on-empty-signal.hpp" |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 31 | |
| 32 | #include "../util/scheduler.hpp" |
| 33 | #include "../util/config-file.hpp" |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 34 | #include "../util/signal.hpp" |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 35 | |
Junxiao Shi | 0fa2845 | 2014-12-13 22:02:36 -0700 | [diff] [blame] | 36 | #include "../transport/transport.hpp" |
| 37 | #include "../transport/unix-transport.hpp" |
| 38 | #include "../transport/tcp-transport.hpp" |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 39 | |
Junxiao Shi | 7357ef2 | 2016-09-07 02:39:37 +0000 | [diff] [blame] | 40 | #include "../mgmt/nfd/controller.hpp" |
| 41 | #include "../mgmt/nfd/command-options.hpp" |
Eric Newberry | 83872fd | 2015-08-06 17:01:24 -0700 | [diff] [blame] | 42 | |
| 43 | #include "../lp/packet.hpp" |
Junxiao Shi | 4b46998 | 2015-12-03 18:20:19 +0000 | [diff] [blame] | 44 | #include "../lp/tags.hpp" |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 45 | |
| 46 | namespace ndn { |
| 47 | |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame] | 48 | /** |
| 49 | * @brief implementation detail of Face |
| 50 | */ |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 51 | class Face::Impl : noncopyable |
| 52 | { |
| 53 | public: |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 54 | typedef ContainerWithOnEmptySignal<shared_ptr<PendingInterest>> PendingInterestTable; |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame] | 55 | typedef std::list<shared_ptr<InterestFilterRecord>> InterestFilterTable; |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 56 | typedef ContainerWithOnEmptySignal<shared_ptr<RegisteredPrefix>> RegisteredPrefixTable; |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 57 | |
| 58 | explicit |
| 59 | Impl(Face& face) |
| 60 | : m_face(face) |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 61 | , m_scheduler(m_face.getIoService()) |
| 62 | , m_processEventsTimeoutEvent(m_scheduler) |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 63 | { |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 64 | auto postOnEmptyPitOrNoRegisteredPrefixes = [this] { |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame] | 65 | this->m_face.getIoService().post([this] { this->onEmptyPitOrNoRegisteredPrefixes(); }); |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 66 | // without this extra "post", transport can get paused (-async_read) and then resumed |
| 67 | // (+async_read) from within onInterest/onData callback. After onInterest/onData |
| 68 | // finishes, there is another +async_read with the same memory block. A few of such |
| 69 | // async_read duplications can cause various effects and result in segfault. |
| 70 | }; |
| 71 | |
| 72 | m_pendingInterestTable.onEmpty.connect(postOnEmptyPitOrNoRegisteredPrefixes); |
| 73 | m_registeredPrefixTable.onEmpty.connect(postOnEmptyPitOrNoRegisteredPrefixes); |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 74 | } |
| 75 | |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame] | 76 | public: // consumer |
Junxiao Shi | a1ea506 | 2014-12-27 22:33:39 -0700 | [diff] [blame] | 77 | void |
Eric Newberry | 83872fd | 2015-08-06 17:01:24 -0700 | [diff] [blame] | 78 | asyncExpressInterest(shared_ptr<const Interest> interest, |
| 79 | const DataCallback& afterSatisfied, |
| 80 | const NackCallback& afterNacked, |
| 81 | const TimeoutCallback& afterTimeout) |
Junxiao Shi | a1ea506 | 2014-12-27 22:33:39 -0700 | [diff] [blame] | 82 | { |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 83 | this->ensureConnected(true); |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 84 | |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame] | 85 | auto entry = m_pendingInterestTable.insert(make_shared<PendingInterest>( |
| 86 | interest, afterSatisfied, afterNacked, afterTimeout, ref(m_scheduler))).first; |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 87 | (*entry)->setDeleter([this, entry] { m_pendingInterestTable.erase(entry); }); |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 88 | |
Eric Newberry | 83872fd | 2015-08-06 17:01:24 -0700 | [diff] [blame] | 89 | lp::Packet packet; |
| 90 | |
Junxiao Shi | 4b46998 | 2015-12-03 18:20:19 +0000 | [diff] [blame] | 91 | shared_ptr<lp::NextHopFaceIdTag> nextHopFaceIdTag = interest->getTag<lp::NextHopFaceIdTag>(); |
| 92 | if (nextHopFaceIdTag != nullptr) { |
| 93 | packet.add<lp::NextHopFaceIdField>(*nextHopFaceIdTag); |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 94 | } |
Eric Newberry | 83872fd | 2015-08-06 17:01:24 -0700 | [diff] [blame] | 95 | |
| 96 | packet.add<lp::FragmentField>(std::make_pair(interest->wireEncode().begin(), |
| 97 | interest->wireEncode().end())); |
| 98 | |
| 99 | m_face.m_transport->send(packet.wireEncode()); |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 100 | } |
| 101 | |
| 102 | void |
| 103 | asyncRemovePendingInterest(const PendingInterestId* pendingInterestId) |
| 104 | { |
| 105 | m_pendingInterestTable.remove_if(MatchPendingInterestId(pendingInterestId)); |
| 106 | } |
| 107 | |
Alexander Afanasyev | 6a05b4b | 2014-07-18 17:23:00 -0700 | [diff] [blame] | 108 | void |
Ilya Moiseenko | 56b0bf8 | 2015-11-08 11:14:28 -0500 | [diff] [blame] | 109 | asyncRemoveAllPendingInterests() |
| 110 | { |
| 111 | m_pendingInterestTable.clear(); |
| 112 | } |
| 113 | |
| 114 | void |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame] | 115 | satisfyPendingInterests(const Data& data) |
| 116 | { |
| 117 | for (auto entry = m_pendingInterestTable.begin(); entry != m_pendingInterestTable.end(); ) { |
| 118 | if ((*entry)->getInterest()->matchesData(data)) { |
| 119 | shared_ptr<PendingInterest> matchedEntry = *entry; |
| 120 | entry = m_pendingInterestTable.erase(entry); |
| 121 | matchedEntry->invokeDataCallback(data); |
| 122 | } |
| 123 | else { |
| 124 | ++entry; |
| 125 | } |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | void |
| 130 | nackPendingInterests(const lp::Nack& nack) |
| 131 | { |
| 132 | for (auto entry = m_pendingInterestTable.begin(); entry != m_pendingInterestTable.end(); ) { |
| 133 | const Interest& pendingInterest = *(*entry)->getInterest(); |
| 134 | if (pendingInterest == nack.getInterest()) { |
| 135 | shared_ptr<PendingInterest> matchedEntry = *entry; |
| 136 | entry = m_pendingInterestTable.erase(entry); |
| 137 | matchedEntry->invokeNackCallback(nack); |
| 138 | } |
| 139 | else { |
| 140 | ++entry; |
| 141 | } |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | public: // producer |
| 146 | void |
| 147 | asyncSetInterestFilter(shared_ptr<InterestFilterRecord> interestFilterRecord) |
| 148 | { |
| 149 | m_interestFilterTable.push_back(interestFilterRecord); |
| 150 | } |
| 151 | |
| 152 | void |
| 153 | asyncUnsetInterestFilter(const InterestFilterId* interestFilterId) |
| 154 | { |
| 155 | InterestFilterTable::iterator i = std::find_if(m_interestFilterTable.begin(), |
| 156 | m_interestFilterTable.end(), |
| 157 | MatchInterestFilterId(interestFilterId)); |
| 158 | if (i != m_interestFilterTable.end()) { |
| 159 | m_interestFilterTable.erase(i); |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | void |
| 164 | processInterestFilters(Interest& interest) |
| 165 | { |
| 166 | for (const auto& filter : m_interestFilterTable) { |
| 167 | if (filter->doesMatch(interest.getName())) { |
| 168 | filter->invokeInterestCallback(interest); |
| 169 | } |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | void |
Junxiao Shi | e7bb6c8 | 2016-08-08 23:16:35 +0000 | [diff] [blame] | 174 | asyncSend(const Block& wire) |
Alexander Afanasyev | 6a05b4b | 2014-07-18 17:23:00 -0700 | [diff] [blame] | 175 | { |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 176 | this->ensureConnected(true); |
Junxiao Shi | e7bb6c8 | 2016-08-08 23:16:35 +0000 | [diff] [blame] | 177 | m_face.m_transport->send(wire); |
Alexander Afanasyev | 6a05b4b | 2014-07-18 17:23:00 -0700 | [diff] [blame] | 178 | } |
| 179 | |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame] | 180 | public: // prefix registration |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 181 | const RegisteredPrefixId* |
| 182 | registerPrefix(const Name& prefix, |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame] | 183 | shared_ptr<InterestFilterRecord> filter, |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 184 | const RegisterPrefixSuccessCallback& onSuccess, |
| 185 | const RegisterPrefixFailureCallback& onFailure, |
Alexander Afanasyev | 0866f51 | 2014-08-11 13:25:09 -0700 | [diff] [blame] | 186 | uint64_t flags, |
Junxiao Shi | 388ec25 | 2014-11-02 15:19:57 -0700 | [diff] [blame] | 187 | const nfd::CommandOptions& options) |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 188 | { |
Junxiao Shi | e7c7f15 | 2016-08-20 22:36:22 +0000 | [diff] [blame] | 189 | nfd::ControlParameters params; |
Joao Pereira | ba1e3b9 | 2015-06-01 17:50:37 -0400 | [diff] [blame] | 190 | params.setName(prefix); |
| 191 | params.setFlags(flags); |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 192 | |
Joao Pereira | ba1e3b9 | 2015-06-01 17:50:37 -0400 | [diff] [blame] | 193 | auto prefixToRegister = make_shared<RegisteredPrefix>(prefix, filter, options); |
Alexander Afanasyev | 0866f51 | 2014-08-11 13:25:09 -0700 | [diff] [blame] | 194 | |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame] | 195 | m_face.m_nfdController->start<nfd::RibRegisterCommand>( |
| 196 | params, |
Junxiao Shi | e7c7f15 | 2016-08-20 22:36:22 +0000 | [diff] [blame] | 197 | [=] (const nfd::ControlParameters&) { this->afterPrefixRegistered(prefixToRegister, onSuccess); }, |
| 198 | [=] (const nfd::ControlResponse& resp) { onFailure(prefixToRegister->getPrefix(), resp.getText()); }, |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame] | 199 | options); |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 200 | |
| 201 | return reinterpret_cast<const RegisteredPrefixId*>(prefixToRegister.get()); |
| 202 | } |
| 203 | |
| 204 | void |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame] | 205 | afterPrefixRegistered(shared_ptr<RegisteredPrefix> registeredPrefix, |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 206 | const RegisterPrefixSuccessCallback& onSuccess) |
| 207 | { |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 208 | m_registeredPrefixTable.insert(registeredPrefix); |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 209 | |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame] | 210 | if (registeredPrefix->getFilter() != nullptr) { |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 211 | // it was a combined operation |
| 212 | m_interestFilterTable.push_back(registeredPrefix->getFilter()); |
| 213 | } |
| 214 | |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame] | 215 | if (onSuccess != nullptr) { |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 216 | onSuccess(registeredPrefix->getPrefix()); |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | void |
| 221 | asyncUnregisterPrefix(const RegisteredPrefixId* registeredPrefixId, |
| 222 | const UnregisterPrefixSuccessCallback& onSuccess, |
| 223 | const UnregisterPrefixFailureCallback& onFailure) |
| 224 | { |
Joao Pereira | ba1e3b9 | 2015-06-01 17:50:37 -0400 | [diff] [blame] | 225 | auto i = std::find_if(m_registeredPrefixTable.begin(), |
| 226 | m_registeredPrefixTable.end(), |
| 227 | MatchRegisteredPrefixId(registeredPrefixId)); |
| 228 | if (i != m_registeredPrefixTable.end()) { |
| 229 | RegisteredPrefix& record = **i; |
Joao Pereira | ba1e3b9 | 2015-06-01 17:50:37 -0400 | [diff] [blame] | 230 | const shared_ptr<InterestFilterRecord>& filter = record.getFilter(); |
| 231 | |
| 232 | if (filter != nullptr) { |
| 233 | // it was a combined operation |
| 234 | m_interestFilterTable.remove(filter); |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 235 | } |
Joao Pereira | ba1e3b9 | 2015-06-01 17:50:37 -0400 | [diff] [blame] | 236 | |
Junxiao Shi | e7c7f15 | 2016-08-20 22:36:22 +0000 | [diff] [blame] | 237 | nfd::ControlParameters params; |
Joao Pereira | ba1e3b9 | 2015-06-01 17:50:37 -0400 | [diff] [blame] | 238 | params.setName(record.getPrefix()); |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame] | 239 | m_face.m_nfdController->start<nfd::RibUnregisterCommand>( |
| 240 | params, |
Junxiao Shi | e7c7f15 | 2016-08-20 22:36:22 +0000 | [diff] [blame] | 241 | [=] (const nfd::ControlParameters&) { this->finalizeUnregisterPrefix(i, onSuccess); }, |
| 242 | [=] (const nfd::ControlResponse& resp) { onFailure(resp.getText()); }, |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame] | 243 | record.getCommandOptions()); |
Joao Pereira | ba1e3b9 | 2015-06-01 17:50:37 -0400 | [diff] [blame] | 244 | } |
Alexander Afanasyev | 851228a | 2014-10-20 15:55:28 -0400 | [diff] [blame] | 245 | else { |
Joao Pereira | ba1e3b9 | 2015-06-01 17:50:37 -0400 | [diff] [blame] | 246 | if (onFailure != nullptr) { |
Alexander Afanasyev | 851228a | 2014-10-20 15:55:28 -0400 | [diff] [blame] | 247 | onFailure("Unrecognized PrefixId"); |
| 248 | } |
| 249 | } |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 250 | |
| 251 | // there cannot be two registered prefixes with the same id |
| 252 | } |
| 253 | |
| 254 | void |
| 255 | finalizeUnregisterPrefix(RegisteredPrefixTable::iterator item, |
| 256 | const UnregisterPrefixSuccessCallback& onSuccess) |
| 257 | { |
| 258 | m_registeredPrefixTable.erase(item); |
| 259 | |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame] | 260 | if (onSuccess != nullptr) { |
Alexander Afanasyev | 9c57818 | 2014-05-14 17:28:28 -0700 | [diff] [blame] | 261 | onSuccess(); |
| 262 | } |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 263 | } |
| 264 | |
Junxiao Shi | 103d8ed | 2016-08-07 20:34:10 +0000 | [diff] [blame] | 265 | public: // IO routine |
| 266 | void |
| 267 | ensureConnected(bool wantResume) |
| 268 | { |
| 269 | if (!m_face.m_transport->isConnected()) |
| 270 | m_face.m_transport->connect(m_face.m_ioService, |
| 271 | [=] (const Block& wire) { m_face.onReceiveElement(wire); }); |
| 272 | |
| 273 | if (wantResume && !m_face.m_transport->isReceiving()) { |
| 274 | m_face.m_transport->resume(); |
| 275 | } |
| 276 | } |
| 277 | |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 278 | void |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 279 | onEmptyPitOrNoRegisteredPrefixes() |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 280 | { |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 281 | if (m_pendingInterestTable.empty() && m_registeredPrefixTable.empty()) { |
| 282 | m_face.m_transport->pause(); |
| 283 | if (!m_ioServiceWork) { |
| 284 | m_processEventsTimeoutEvent.cancel(); |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 285 | } |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | private: |
| 290 | Face& m_face; |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 291 | util::Scheduler m_scheduler; |
| 292 | util::scheduler::ScopedEventId m_processEventsTimeoutEvent; |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 293 | |
| 294 | PendingInterestTable m_pendingInterestTable; |
| 295 | InterestFilterTable m_interestFilterTable; |
| 296 | RegisteredPrefixTable m_registeredPrefixTable; |
| 297 | |
Alexander Afanasyev | 9d158f0 | 2015-02-17 21:30:19 -0800 | [diff] [blame] | 298 | unique_ptr<boost::asio::io_service::work> m_ioServiceWork; // if thread needs to be preserved |
Alexander Afanasyev | 258ec2b | 2014-05-14 16:15:37 -0700 | [diff] [blame] | 299 | |
| 300 | friend class Face; |
| 301 | }; |
| 302 | |
| 303 | } // namespace ndn |
| 304 | |
| 305 | #endif // NDN_DETAIL_FACE_IMPL_HPP |