Ejemplo n.º 1
0
 private void UpdateUnknownRouters(SortedDictionary <string, RouterReplica> _data, string _neighbourId)
 {
     for (int i = 0; i < _data.Count; i++)
     {
         if (!routingTable.ContainsKey(_data.ElementAt(i).Key) && _data.ElementAt(i).Value.SequenceCount % 2 == 0)
         {
             RouterReplica replica = new RouterReplica(_data.ElementAt(i).Key, _neighbourId, _data.ElementAt(i).Value.SequenceNumber, int.MaxValue);
             replica.LostConnection += self.LostConnection;
             routingTable.Add(_data.ElementAt(i).Key, replica);
         }
     }
 }
Ejemplo n.º 2
0
 public void UpdateLink(RouterReplica _router)
 {
     if (!routingTable.ContainsKey(_router.Id))
     {
         routingTable.Add(_router.Id, _router);
     }
     else
     {
         routingTable[_router.Id].Distance       = _router.Distance;
         routingTable[_router.Id].NextHop        = _router.NextHop;
         routingTable[_router.Id].SequenceNumber = _router.SequenceNumber;
     }
 }