Bug #3130
closedRegisterPrefix doesn't provide a callback
0%
Description
When face.registerPrefix() is called immediately followed by face.ExpressInterest(), Interests time out.
This happens since registerPrefix takes some time to complete and when Data comes back, it doesn't find any faces with the handle.
For the following code first few Data packets will timeout.
face.registerPrefix(prefix, self.onInterest, self.onRegisterFailed)
print("Registering prefix", prefix.toUri())
#express Interest
interest = Interest(Name(publish))
interest.setInterestLifetimeMilliseconds(4000)
interest.setMustBeFresh(True)
self.face.expressInterest(interest, self._onData, self._onTimeout)
print("Expressed Interest %s" %(interest.getName()))
Updated by Anonymous about 9 years ago
Hello Susmit. In jNDN (the Java library), we added an OnRegisterSuccess callback to registerPrefix:
https://github.com/named-data/jndn/blob/5f5583a95afe48644e4dcd736bee6bf34a107b4d/src/net/named_data/jndn/Face.java#L504
We have plans to add the same for the other libraries including PyNDN. Would that meet your needs? If so, I can raise the priority of implementing this in PyNDN.
Updated by susmit shannigrahi about 9 years ago
Yes, this will be sufficient. Please raise the priority.
Updated by Anonymous about 9 years ago
- Is duplicate of Feature #3005: Add callback for successful prefix registration added
Updated by Anonymous about 9 years ago
- Status changed from New to Closed
I re-opened issue #3005 for implementing OnRegisterSuccess in all the libraries, including PyNDN, so please follow it. I'm closing this issue as a duplicate.
Updated by Anonymous about 9 years ago
Hi Susmit. I implemented the optional onRegisterSuccess callback in registerPrefix.
https://github.com/named-data/PyNDN2/blob/874fbfd29358f497b9e7d00b25417af11d62d8ba/python/pyndn/face.py#L256
Updated by susmit shannigrahi about 9 years ago
Thanks Jeff. Do you think it's possible to have it in the ndn-js library too? That would be helpful.
Updated by Anonymous about 9 years ago
Yes, I plan to add onRegisterSuccess in NDN-JS. First I need to remove support for NDNx in registerPrefix, which I'll do before NDNcomm. Then I'll add onRegisterSuccess after NDNcomm. Is that OK?
Updated by Anonymous about 9 years ago
Great. I will update issue #3005 when it's done.