Example #1
0
        public void Start(IPScanRange range)
        {
            lock (_runControlLock)
            {
                CheckRunning();

                _aliveHosts.Clear();

                if (_pingers != null)
                {
                    foreach (PingerEntry p in _pingers)
                    {
                        p._ping.PingCompleted -= pinger_PingCompleted;
                    }
                }

                _pingers = new PingerEntry[_concurrentPings];
                for (int i = _concurrentPings - 1; i >= 0; i--)
                {
                    _pingers[i] = new PingerEntry();
                    _pingers[i]._ping.PingCompleted += new PingCompletedEventHandler(pinger_PingCompleted);
                }

                _range = range;

                _active = true;
                _stopEvent.Reset();

                RaiseOnStartScan();

                Thread t = new Thread(new ThreadStart(Restart));
                t.Start();
            }
        }
Example #2
0
        public void Start(IPScanRange range)
        {
            lock (_runControlLock)
            {
                CheckRunning();

                _aliveHosts.Clear();

                if (_pingers != null)
                {
                    foreach (PingerEntry p in _pingers)
                        p._ping.PingCompleted -= pinger_PingCompleted;
                }

                _pingers = new PingerEntry[_concurrentPings];
                for (int i = _concurrentPings - 1; i >= 0; i--)
                {
                    _pingers[i] = new PingerEntry();
                    _pingers[i]._ping.PingCompleted += new PingCompletedEventHandler(pinger_PingCompleted);
                }

                _range = range;

                _active = true;
                _stopEvent.Reset();

                RaiseOnStartScan();

                Thread t = new Thread(new ThreadStart(Restart));
                t.Start();
            }
        }