Пример #1
0
 void PortStatisticsManagerThread()
 {
     portStatisticsManager = new PortStatisticsManager(secondsToKeepNetworkSamples, secondsToClosePIDPortsWithNoRequests, secondsToUpdatePidToPortsTable);
     while (Thread.CurrentThread.ThreadState == ThreadState.Running)
     {
         Thread.Sleep(updateNetworkInfoEveryMiliseconds);
         portStatisticsManager.Tick();
     }
 }
Пример #2
0
        public PidConnector()
        {
            portStatisticsManager       = new PortStatisticsManager(secondsToKeepNetworkSamples, secondsToClosePIDPortsWithNoRequests, secondsToUpdatePidToPortsTable);
            portStatisticsManagerThread = new Thread(PortStatisticsManagerThread)
            {
                Name           = "portStatisticsManagerThread",
                IsBackground   = true,
                CurrentCulture = System.Globalization.CultureInfo.InvariantCulture
            };
            portStatisticsManagerThread.Start();

            processInfoManager = new ProcessInfoManager(numberOfProcessInfoSamplesToAverage, secondsToKeepWatchingProcessWithNoRequests);
            processInfoThread  = new Thread(ProcessInfoThread)
            {
                Name           = "processInfoThread",
                IsBackground   = true,
                CurrentCulture = System.Globalization.CultureInfo.InvariantCulture
            };
            processInfoThread.Start();
        }