[Ndn-lib] PSync Consumer: handle application nack

Junxiao Shi shijunxiao at email.arizona.edu
Tue Jan 29 15:30:09 PST 2019

Hi Ashlesh

> what's the rationale of requiring the application to invoke
> Consumer::sendHelloInterest (after construction) and
> Consumer::sendSyncInterest (after subscription)? Why can't they be called
> automatically (in constructor and after subscription when io_service runs)?
> Yes, sendHelloInterest can be done in constructor. But in case some
> application has its own mechanism such that it knows the names before hand
> and does not want to send hello.

The easy solution is passing an option to the constructor, with the default
being sendHelloInterest automatically. This'll make the library easier to
To avoid having too many constructor arguments, wrap optional options into
a struct. Required options such as Face should still be passed directly.

> For sendSyncInterest, how does the Consumer class know that the
> application is done subscribing?
> When io_service is polled for the next time, Consumer class can invoke
To achieve this, keep a ScopedEventId in Consumer class, and (re-)schedule
an event for sendSyncInterest at zero timeout within addSubscription
In case application calls addSubscription later, the result of
Face::expressInterest should be assigned to a ScopedPendingInterestHandle
so that response to older sync Interest would be dropped and not
incorrectly processed.

Yours, Junxiao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndn-lib/attachments/20190129/7ab00c0a/attachment.html>

More information about the Ndn-lib mailing list