コード例 #1
0
ファイル: Program.cs プロジェクト: jaapjolman/getpidinfo
 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();
        }