new PendingInterestTable()
A PendingInterestTable is an internal class to hold a list of pending
interests with their callbacks.
- Source:
Classes
Methods
add(pendingInterestId, interestCopy, onData, onTimeout, onNetworkNack) → {PendingInterestTable.Entry}
Add a new entry to the pending interest table. Also set a timer to call the
timeout. However, if removePendingInterest was already called with the
pendingInterestId, don't add an entry and return null.
Parameters:
Name | Type | Description |
---|---|---|
pendingInterestId |
number | |
interestCopy |
Interest | |
onData |
function | |
onTimeout |
function | |
onNetworkNack |
function |
- Source:
Returns:
The new PendingInterestTable.Entry, or
null if removePendingInterest was already called with the pendingInterestId.
extractEntriesForExpressedInterest(data, entries)
Find all entries from the pending interest table where data conforms to
the entry's interest selectors, remove the entries from the table, and add to
the entries list.
Parameters:
Name | Type | Description |
---|---|---|
data |
Data | The incoming Data packet to find the interest for. |
entries |
Array.<PendingInterestTable.Entry> | Add matching PendingInterestTable.Entry from the pending interest table. The caller should pass in an empty array. |
- Source:
extractEntriesForNackInterest(interest, entries)
Find all entries from the pending interest table where the OnNetworkNack
callback is not null and the entry's interest is the same as the given
interest, remove the entries from the table, and add to the entries list.
(We don't remove the entry if the OnNetworkNack callback is null so that
OnTimeout will be called later.) The interests are the same if their default
wire encoding is the same (which has everything including the name, nonce,
link object and selectors).
Parameters:
Name | Type | Description |
---|---|---|
interest |
Interest | The Interest to search for (typically from a Nack packet). |
entries |
Array.<PendingInterestTable.Entry> | Add matching PendingInterestTable.Entry from the pending interest table. The caller should pass in an empty array. |
- Source:
removePendingInterest(pendingInterestId)
Remove the pending interest entry with the pendingInterestId from the pending
interest table. This does not affect another pending interest with a
different pendingInterestId, even if it has the same interest name.
If there is no entry with the pendingInterestId, do nothing.
Parameters:
Name | Type | Description |
---|---|---|
pendingInterestId |
number | The ID returned from expressInterest. |
- Source: