Bug #3342
closedInterests without explicit InterestLifetime do not trigger onTimeout callback
0%
Description
When creating an Interest if InterestLifetime is not explicitly set before calling Face.expressInterest() the onTimeout callback is never executed.
In Node.java the method expressInterestHelper() only sets up the timeout callback if InterestLifetime >= 0. Since InterestLifetime == -1 if not specified, the timeout callback is ignored.
I think this is a bug, and was certainly unexpected, since I had read at http://named-data.net/doc/NDN-TLV/current/interest.html#interestlifetime that the default timeout for an Interest would be 4 seconds if a timeout was not specified. I was expecting that the jndn library would call my timeout handler after 4 seconds. It seems that the correct behavior should be to use a (local) InterestLifetime of 4 seconds in expressInterestHelper() if InterestLifetime == -1.
I have attached a simple test case showing this issue.
Files
Updated by Anonymous about 9 years ago
- Assignee set to Anonymous
Thanks for the report. You have a point. I hadn't considered the case where the interest lifetime is omitted, but expressInterest is supplied an OnTimeout callback. It think I understand your solution and agree: The library will still send the interest over the wire with the interest lifetime omitted. But if expressInterest is supplied an OnTimeout callback, then it will be called after 4000 milliseconds. Is that right?
Updated by Mathias Gibbens about 9 years ago
Jeff, yes, that's what I was thinking of.
Updated by Anonymous about 9 years ago
- Project changed from jndn to NDN-CCL
OK. I moved this to the NDN-CCL project since it affects all the Common Client Libraries. I'll fix it first in jNDN.
Updated by Anonymous about 9 years ago
Hi Mathias. I merged the fix in jNDN. Can you try it and tell me if it does what you expect?
Updated by Mathias Gibbens about 9 years ago
Jeff, thanks! I've tested the fix and it now works as I was expecting when an Interest doesn't explicitly set the lifetime.
Updated by Anonymous about 9 years ago
- Status changed from New to Closed
Thanks for checking. I updated the other libraries too.
Updated by Anonymous almost 9 years ago
- Has duplicate Task #3194: expressInterest should call onTimeout even for unspecified interest lifetime added