Exemple #1
0
 private void RemoveFile(CCBP2PFileList filelist, string file)
 {
     lock (filelist)
     {
         filelist.Remove(file);
     }
 }
Exemple #2
0
 public CCBP2PFileWorker(ManualResetEvent closeEvent) : base()
 {
     m_closeSignal              = closeEvent;
     m_inbox                    = new CCBP2PFileList();
     m_outbox                   = new CCBP2PFileList();
     m_signal                   = new ManualResetEvent(false);
     m_dataPumpThread           = null;
     m_fileTransferDoneCallback = null;
 }
Exemple #3
0
        private List <CCBP2PFile> ScanForWork(CCBP2PFileList filelist)
        {
            List <CCBP2PFile> files = new List <CCBP2PFile>();

            lock (filelist)
            {
                foreach (CCBP2PFile file in filelist.Values)
                {
                    files.Add(file);
                }
            }
            return(files);
        }
Exemple #4
0
 private void CloseAll(CCBP2PFileList files)
 {
     lock (files)
     {
         foreach (CCBP2PFile file in files.Values)
         {
             try
             {
                 file.Close();
             }
             catch (IOException ioex)
             {
                 CCBLogConfig.GetLogger().Error("IO Exception closing file {0}: {1}", file.LocalName, ioex.Message);
             }
             catch (Exception ex)
             {
                 CCBLogConfig.GetLogger().Error("Exception closing file {0}: {1}", file.LocalName, ex.Message);
             }
         }
     }
 }