Beispiel #1
0
        private void ProcessHop(IPAddress address, IPStatus status)
        {
            var roundTripTime = this.GetRoundtripTime(address, ref status);

            if (this.cancel)
            {
                return;
            }

            var hop = new TraceRouteHopData(this.counter++, address, roundTripTime, status, this.ResolveNames);

            lock (this.hopList)
            {
                this.hopList.Add(hop);
            }

            this.OnRouteHopFound(hop);
            this.Idle = address.Equals(this.destinationIP);

            lock (this.hopList)
            {
                if (!this.Idle && this.hopList.Count >= this.HopLimit - 1)
                {
                    this.ProcessHop(this.destinationIP, IPStatus.Success);
                }
            }

            if (this.Idle)
            {
                this.OnCompleted();
                this.Dispose();
            }
        }
Beispiel #2
0
 private void OnRouteHopFound(TraceRouteHopData hop)
 {
     if (this.RouteHopFound != null)
     {
         this.RouteHopFound(this, new RouteHopFoundEventArgs(hop, this.Idle));
     }
 }
Beispiel #3
0
 private void OnRouteHopFound(TraceRouteHopData hop)
 {
     this.RouteHopFound?.Invoke(this, new RouteHopFoundEventArgs(hop, this.Idle));
 }
 public RouteHopFoundEventArgs(TraceRouteHopData hop, Boolean isLast)
 {
     this.Hop = hop;
     this.IsLastNode = isLast;
 }
Beispiel #5
0
 public RouteHopFoundEventArgs(TraceRouteHopData hop, Boolean isLast)
 {
     this.Hop        = hop;
     this.IsLastNode = isLast;
 }
        private void ProcessHop(IPAddress address, IPStatus status)
        {
            Int64 roundTripTime = this.GetRoundtripTime(address, ref status);

            if (this.cancel)
                return;

            var hop = new TraceRouteHopData(counter++, address, roundTripTime, status, this.ResolveNames);
            lock (this.hopList)
                this.hopList.Add(hop);
            this.OnRouteHopFound(hop);
            this.Idle = address.Equals(this.destinationIP);

            lock (this.hopList)
            {
                if (!this.Idle && hopList.Count >= this.HopLimit - 1)
                    this.ProcessHop(this.destinationIP, IPStatus.Success);
            }

            if (this.Idle)
            {
                this.OnCompleted();
                this.Dispose();
            }
        }
 private void OnRouteHopFound(TraceRouteHopData hop)
 {
     if (this.RouteHopFound != null)
         this.RouteHopFound(this, new RouteHopFoundEventArgs(hop, this.Idle));
 }