Пример #1
0
        public void Start()
        {
            IsRunning = true;

            FileInfo[] fi = null;

            while (IsRunning)
            {
                try
                {
                    if (_processedFilesPath != "")
                    {
                        CaptureFileData cfd = new CaptureFileData();

                        DirectoryInfo di = new DirectoryInfo(_processedFilesPath);
                        fi = di.GetFiles("*.pcap");
                        if (fi.Length > 0)
                        {
                            foreach (var file in fi)
                            {
                                if (!updatedFiles.ContainsKey(file.Name))
                                {
                                    int batchId = cfd.GetBatchId(file.Name);
                                    if (batchId > 0)
                                    {
                                        cfd.UpdateCaptureBatchParseStatus(batchId);
                                        updatedFiles.Add(file.Name, batchId);
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        Thread.Sleep(3000);
                    }
                }
                catch (Exception ex)
                {
                    // Ignore file not found errors
                    //throw new Exception("ParsedFileNotifier unable to find parsed pcap files: " + ex.Message);
                }
            }
        }
Пример #2
0
 private void UpdateCaptureBatchParseStatusForRecalculation(int captureBatchId)
 {
     CaptureFileData cfd = new CaptureFileData();
     cfd.UpdateCaptureBatchParseStatus(captureBatchId);
 }
Пример #3
0
 private void UpdateCaptureBatchParseStatus()
 {
     CaptureFileData cfd = new CaptureFileData();
     cfd.UpdateCaptureBatchParseStatus(_CurrentCaptureBatchId);
 }