Task #2860
Updated by Anonymous over 9 years ago
If an application calls expressInterest several times, the library needs to connect on the first call. With blocking I/O the connection is complete before sending the first interest. But with async I/O, the connection happens on another thread while expressInterest is called several more times, and these cannot yet send the interest. Also, the interest timeout should measure from the time that the interest is sent, not from when expressInterest is called. Therefore, expressInterest should internally queue the interests while async I/O is connecting. (The library should also queue calls to removePendingInterest.) When the library receives the async I/O onConnected callback, then it can put the interests in the PIT (if the application did not cancel with removePendingInterest), start the timeout timers and send the interests. We already do to this in NDN-JS (which always had async I/O). But I opened this issue so we could discuss the approach before implementing in Java, etc. Shall I proceed to implement this approach? Here is the NDN-JS onConnected callback:<br> https://github.com/named-data/ndn-js/blob/c0ebbe5954c0ae7dbee80dcf20d9c58a0b8145b5/js/face.js#L634