Jeff Thompson | aa4e6db | 2013-07-15 17:25:23 -0700 | [diff] [blame] | 1 | /** |
Jeff Thompson | 7687dc0 | 2013-09-13 11:54:07 -0700 | [diff] [blame^] | 2 | * Copyright (C) 2013 Regents of the University of California. |
| 3 | * @author: Jeff Thompson <jefft0@remap.ucla.edu> |
Jeff Thompson | aa4e6db | 2013-07-15 17:25:23 -0700 | [diff] [blame] | 4 | * See COPYING for copyright and distribution information. |
| 5 | */ |
| 6 | |
Jeff Thompson | b9e3c8e | 2013-08-02 11:42:51 -0700 | [diff] [blame] | 7 | #include "face.hpp" |
Jeff Thompson | aa4e6db | 2013-07-15 17:25:23 -0700 | [diff] [blame] | 8 | |
Jeff Thompson | b982b6d | 2013-07-15 18:15:45 -0700 | [diff] [blame] | 9 | using namespace std; |
| 10 | |
Jeff Thompson | aa4e6db | 2013-07-15 17:25:23 -0700 | [diff] [blame] | 11 | namespace ndn { |
Jeff Thompson | 9657bda | 2013-07-16 16:23:41 -0700 | [diff] [blame] | 12 | |
Jeff Thompson | 1656e6a | 2013-08-29 18:01:48 -0700 | [diff] [blame] | 13 | void Face::expressInterest(const Name& name, const Interest *interestTemplate, const OnData& onData, const OnTimeout& onTimeout) |
Jeff Thompson | fb29cda | 2013-08-24 10:26:54 -0700 | [diff] [blame] | 14 | { |
| 15 | if (interestTemplate) |
| 16 | node_.expressInterest(Interest |
| 17 | (name, interestTemplate->getMinSuffixComponents(), interestTemplate->getMaxSuffixComponents(), |
| 18 | interestTemplate->getPublisherPublicKeyDigest(), interestTemplate->getExclude(), |
| 19 | interestTemplate->getChildSelector(), interestTemplate->getAnswerOriginKind(), |
| 20 | interestTemplate->getScope(), interestTemplate->getInterestLifetimeMilliseconds()), onData, onTimeout); |
| 21 | else |
| 22 | node_.expressInterest(Interest(name, 4000.0), onData, onTimeout); |
| 23 | } |
| 24 | |
Jeff Thompson | 517ffa8 | 2013-08-05 16:04:34 -0700 | [diff] [blame] | 25 | void Face::shutdown() |
| 26 | { |
Jeff Thompson | bf50a1a | 2013-08-20 18:01:01 -0700 | [diff] [blame] | 27 | node_.shutdown(); |
Jeff Thompson | aa4e6db | 2013-07-15 17:25:23 -0700 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | } |