/// <summary> /// Create a new Node for communication with an NDN hub with the given /// Transport object and connectionInfo. /// </summary> /// /// <param name="transport">A Transport object used for communication.</param> /// <param name="connectionInfo"></param> public Node(Transport transport, Transport.ConnectionInfo connectionInfo) { this.pendingInterestTable_ = new PendingInterestTable(); this.interestFilterTable_ = new InterestFilterTable(); this.registeredPrefixTable_ = new RegisteredPrefixTable( interestFilterTable_); this.delayedCallTable_ = new DelayedCallTable(); this.onConnectedCallbacks_ = ILOG.J2CsMapping.Collections.Collections .synchronizedList(new ArrayList()); this.commandInterestGenerator_ = new CommandInterestGenerator(); this.timeoutPrefix_ = new Name("/local/timeout"); this.lastEntryIdLock_ = new Object(); this.connectStatus_ = net.named_data.jndn.Node.ConnectStatus.UNCONNECTED; transport_ = transport; connectionInfo_ = connectionInfo; }
/// <summary> /// This is used in callLater for when the pending interest expires. If the /// pendingInterest is still in the pendingInterestTable_, remove it and call /// its onTimeout callback. /// </summary> /// /// <param name="pendingInterest">The pending interest to check.</param> internal void processInterestTimeout( PendingInterestTable.Entry pendingInterest) { if (pendingInterestTable_.removeEntry(pendingInterest)) pendingInterest.callTimeout(); }
public bool removeEntry(PendingInterestTable.Entry pendingInterest) { if (pendingInterest.getIsRemoved()) // extractEntriesForExpressedInterest or removePendingInterest has // removed pendingInterest from the table, so we don't need to look for it. // Do nothing. return false; if (ILOG.J2CsMapping.Collections.Collections.Remove(table_,pendingInterest)) { pendingInterest.setIsRemoved(); return true; } else return false; }