Пример #1
0
 public Channel(int bufferMaxSize)
 {
     SBuffer = new Queue<NetPacket>();
     BufferMaxSize = bufferMaxSize;
     MinThread = 1;
     MaxThread = 1;
 }
        public Queue Concat(Queue q1, Queue q2)
        {
            if (q1 == null & q2 == null)
               {
                return new Queue();
               }
               else if (q1 == null)
               {
                return (Queue)q2.GetClone();
               }
               else if (q2 == null)
               {
                return (Queue)q1.GetClone();
               }
               else
               {
                Queue newQueue = (Queue) q1.GetClone();
                foreach(int element in q2.queue)
                {
                    newQueue.queue.Enqueue(element);
                }

               return newQueue;

               }
        }
Пример #3
0
        public Sensor(int id, int bufferMaxSize)
        {
            Id = id;
            PBuffer = new Queue<NetPacket>();
            SBuffer = new Queue<NetPacket>();
            NumOfReceive = 0;
            BufferMaxSize = bufferMaxSize;

            MinThreadSending = 1;
            MinThreadSending = 1;

            MinThreadProcessing = 1;
            MaxThreadProcessing = 1;

            DroppedState = false;
        }