<div dir="ltr">Thanks for your reply.<div><br></div><div>Can I use SegmentFetcher::fetch? </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 12, 2017 at 10:16 PM, Spyridon (Spyros) Mastorakis <span dir="ltr"><<a href="mailto:mastorakis@cs.ucla.edu" target="_blank">mastorakis@cs.ucla.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi,<div><br></div><div>the class you tried to modify derives from the Consumer class.</div><div><br></div><div>I would suggest you modify the Consumer class directly.</div><div><br></div><div>Thanks,</div><div><br></div><div><div>
<div><div><div><span style="float:none;display:inline!important">Spyridon (Spyros) Mastorakis</span><br><span style="float:none;display:inline!important">Personal Website: </span><a href="http://cs.ucla.edu/~mastorakis/" target="_blank">http://cs.ucla.edu/~<wbr>mastorakis/</a><br><span style="float:none;display:inline!important">Internet Research Laboratory</span><br><span style="float:none;display:inline!important">Computer Science Department</span><br><span style="float:none;display:inline!important">UCLA</span></div></div></div>
</div><div><div class="h5">
<br><div><blockquote type="cite"><div>On Apr 12, 2017, at 7:08 PM, Amir Ibrahim <<a href="mailto:a.ibrahim@fci-cu.edu.eg" target="_blank">a.ibrahim@fci-cu.edu.eg</a>> wrote:</div><br class="m_-90843617345056225Apple-interchange-newline"><div><div dir="ltr">Hi All,<div> I'm trying to create a new ndn application that sends interest packet for a content as follow:</div><div>- Each content consists of more than one segment.</div><div>- When a node wants to retrieve a content, it sends interest packets for each segment of that content (ex: if content /prefix/file01 has 2 segments the app should send 2 interest packets</div><div>/prefix/file01/01 and /prefix/file01/02)</div><div><br></div><div>My trials to do so are:</div><div>1. I tried to modify the ConsumerZipfMandelbrot.cpp application by adding the below lines of code to the SendPacket() method:</div><div><br></div><div><div><b>for (uint64_t j = 0; j <m_ChunksPerContent[seq-1]; j++) {</b></div><div><br></div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>  // prepare the name of content/file</div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  shared_ptr<Name> nameWithSequence = make_shared<Name>(m_<wbr>interestName);</div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">      </span>  nameWithSequence-><wbr>appendSequenceNumber(seq);</div><div><br></div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  std::cout<<"name befor segment: "<<nameWithSequence->toUri()<<<wbr>"\n";</div><div><br></div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">   </span>  <b>nameWithSequence-><wbr>appendSegment(j+1); </b>// adding chunk number</div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap"><br></span></div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>  std::cout<<"name After segment: "<<nameWithSequence->toUri()<<<wbr>"\n";</div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">    </span>  //std::cout<<"requesting file.chunk"<<seq<<"."<<j+1<<"\<wbr>n";</div><div><br></div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>  //Amir: Create the interest packet</div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>  shared_ptr<Interest> interest = make_shared<Interest>();</div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">       </span>  interest->setNonce(m_rand-><wbr>GetValue(0, std::numeric_limits<uint32_t>:<wbr>:max()));</div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">   </span>  interest->setName(*<wbr>nameWithSequence);</div><div><br></div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">       </span>  // NS_LOG_INFO ("Requesting Interest: \n" << *interest);</div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">   </span>  NS_LOG_INFO("> Interest for " << seq << ", Total: " << m_seq << ", face: " << m_face->getId());</div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">  </span>  NS_LOG_DEBUG("Trying to add " << seq << " with " << Simulator::Now() << ". already "</div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">                 </span>  << m_seqTimeouts.size() << " items");</div><div><br></div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">       </span>  m_seqTimeouts.insert(<wbr>SeqTimeout(seq, Simulator::Now()));</div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  m_seqFullDelay.insert(<wbr>SeqTimeout(seq, Simulator::Now()));</div><div><br></div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">      </span>  m_seqLastDelay.erase(seq);</div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>  m_seqLastDelay.insert(<wbr>SeqTimeout(seq, Simulator::Now()));</div><div><br></div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">      </span>  m_seqRetxCounts[seq]++;</div><div><br></div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">   </span>  m_rtt->SentSeq(<wbr>SequenceNumber32(seq), 1);</div><div><br></div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">   </span>  m_transmittedInterests(<wbr>interest, this, m_face);</div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>  m_appLink->onReceiveInterest(<wbr>*interest);</div><div><br></div><div><span class="m_-90843617345056225gmail-Apple-tab-span" style="white-space:pre-wrap">    </span>  MyConsumerZipfMandelbrot::<wbr>ScheduleNextPacket();</div><div><b>  }</b></div></div><div><div><br></div><div>But every time I run I get an error .</div><div><br></div><div>My question is: how do I add a segment number to the interest name (highlighted line )?</div><div><br></div><div>Also, is there any problem to create a for loop to repeat the creation of interests per segments of a content as above?</div><div><br></div>-- <br><div class="m_-90843617345056225gmail_signature"><div dir="ltr">   Regards<br>Prince</div></div>
</div></div>

<br><br></div></blockquote></div><br></div></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">   Regards<br>Amir I. Mohamad<br>Assistant Lecturer <br>Faculty of Computers & Information<br>IT Dept. Cairo University</div></div>
</div>

<br>
<br>