void PortStatisticsManagerThread() { portStatisticsManager = new PortStatisticsManager(secondsToKeepNetworkSamples, secondsToClosePIDPortsWithNoRequests, secondsToUpdatePidToPortsTable); while (Thread.CurrentThread.ThreadState == ThreadState.Running) { Thread.Sleep(updateNetworkInfoEveryMiliseconds); portStatisticsManager.Tick(); } }
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(); }