Project

General

Profile

Actions

Bug #2318

closed

DummyClientFace: setInterestFilter(InterestFilter, OnInterest) is not effective by itself

Added by Junxiao Shi almost 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Utils
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
2.00 h

Description

Snippet to reproduce:

#include <ndn-cxx/util/dummy-client-face.hpp>
#include <boost/asio.hpp>

using std::bind;
using std::shared_ptr;
using ndn::Name;
using ndn::Interest;
using ndn::util::DummyClientFace;

int
main()
{
  boost::asio::io_service io;
  shared_ptr<DummyClientFace> face = ndn::util::makeDummyClientFace(io, {false, true});
  //face->setInterestFilter(Name("/"), bind([]{}), bind([]{}));
  face->setInterestFilter(Name("/"),
      bind([] (const Interest& interest) { std::cout << interest << std::endl; }, _2));

  io.poll();
  io.reset();

  Interest interest("/A");
  face->receive(interest);

  io.poll();
  io.reset();
  return 0;
}

Expected: Interest is received by handler.

Actual: Interest is not received by handler.

Note: If the registerPrefix+setInterestFilter combination operation is uncommented, the handler can receive the Interest.


Related issues 1 (0 open1 closed)

Blocks NFD - Feature #1999: Strategy for access routerClosedJunxiao Shi

Actions
Actions

Also available in: Atom PDF