Пример #1
0
        internal bool Store(int lIndex, NNTPCommands nCom)
        {
            if (lIndex != zIndex)
            {
                return(Queue(lIndex, nCom));
            }

            bool ret = Write(nCom);

            Interlocked.Increment(ref zIndex);

            if (ret)
            {
                while (zCol.ContainsKey(zIndex))
                {
                    NNTPCommands gCom = (NNTPCommands)zCol.Take();

                    if (gCom == null)
                    {
                        break;
                    }
                    if (gCom.ID != zIndex)
                    {
                        break;
                    }

                    if (!Write(gCom))
                    {
                        break;
                    }
                    Interlocked.Increment(ref zIndex);
                }
            }

            if (zTotal == (zIndex - 1))
            {
                bFinished = true;
            }

            return(ret);
        }
Пример #2
0
 internal bool ContainsKey(int SlotID) { return zCol.ContainsKey(SlotID); }