Beispiel #1
0
        protected override void OnMergeTo(CAsyncServiceHandler to)
        {
            CStreamingFile fTo = (CStreamingFile)to;

            lock (fTo.m_csFile)
            {
                int pos   = 0;
                int count = fTo.m_vContext.Count;
                foreach (CContext cxt in fTo.m_vContext)
                {
                    if (cxt.ErrCode == 0 && cxt.ErrMsg.Length == 0 && cxt.File == null)
                    {
                        break;
                    }
                    ++pos;
                }
                lock (m_csFile)
                {
                    fTo.m_vContext.InsertRange(pos, m_vContext);
                    m_vContext.Clear();
                }
                if (count == 0 && fTo.m_vContext.Count > 0)
                {
                    ClientCoreLoader.PostProcessing(fTo.Socket.Handle, 0, 0);
                    fTo.Socket.DoEcho(); //make sure WaitAll works correctly
                }
            }
        }
Beispiel #2
0
        protected override void OnMergeTo(CAsyncServiceHandler to)
        {
            CStreamingFile fTo = (CStreamingFile)to;

            lock (fTo.m_csFile) {
                lock (m_csFile) {
                    fTo.m_vContext.InsertRange(fTo.m_vContext.Count, m_vContext);
                    m_vContext.Clear();
                }
            }
        }