[ndnSIM] Ways to create new Interest object
mudasirqazi00 at gmail.com
Wed Apr 4 08:17:07 PDT 2018
@Spyridon (Spyros) Mastorakis, I did not know the actual problem at that
time that's why I was unable to mention it. The answer of the @Junxiao Shi
solved that specific error for me. Thanks to both of you for response and
help. I want to know should I still be creating new nonce for interest?
I'm getting another problem which I think is related to previous one, let
me explain it below:
shared_ptr<lp::NextHopFaceIdTag> nextHopTag =
Above line in onContentStoreMiss method in Forwarder.cpp always returns
*nullptr* making if (nextHopTag != nullptr) returns false at very next
line. So the execution does not goes inside this if-block. This way,
following statement inside the if-block
this->onOutgoingInterest(pitEntry, *nextHopFace, interest);
never executed and hence the Interest is not flooded to neighboring nodes.
Why the nextHopTag is null in Interest? What is the solution of it? Am I
missing something? Please help.
On 4 April 2018 at 05:35, Junxiao Shi <shijunxiao at email.arizona.edu> wrote:
> Hi Mudasir
>> *Method #2:* Creating Interest from an existing Interest like this:
>> const Name& tempName = "---";
>> Interest tempInterest = Interest(interest.wireEncode());
>> *My problem:*
>> Now, I know Method#2 is the official way that meets my requirements. But
>> the thing is, when I use method#2 it gives error on *findOrInsert*
>> method in *pit.cpp* file and I don't understand its reason.
>> auto entry = make_shared<Entry>(interest);
> In certain contexts that use Interest::shared_from_this(), Interest must
> be created using `make_shared`. Otherwise, .shared_from_this() will trigger
> undefined behavior.
> PIT is one of those contexts. So are many other places in NFD.
> Thus, you need:
> auto tempInterest = std::make_shared<Interest>(interest.wireEncode());
> Yours, Junxiao
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ndnSIM