Esempio n. 1
0
        /**
         * Our comparator sorts from high to low priority, and secondarily by
         * sequence number to provide FIFO ordering.
         */
        public int compareTo(SendPacket other)
        {
            if (other == null)
            {
                return(0);
            }
            Priority left  = this.GetPriority();
            Priority right = other.GetPriority();

            // High-priority requests are "lesser" so they are sorted to the front.
            // Equal priorities are sorted by sequence number to provide FIFO
            // ordering.
            //return left == right ? 0 : right.ordinal() - left.ordinal();

            ConcurrentQueue <object> aa = new ConcurrentQueue <object>();

            Action a = () =>
            {
            };

            a.Invoke();
            return(0);
        }
Esempio n. 2
0
 internal void Cancel(SendPacket packet)
 {
     //mSendQueue.(entity);
 }
Esempio n. 3
0
 public void PostSendProgress(SendPacket entity, float progress)
 {
     if (entity != null && entity.Listener != null)
         PostQueue(new SendDeliveryRunnable(entity, progress));
 }
Esempio n. 4
0
 internal void Cancel(SendPacket packet)
 {
     mSendDispatcher.Cancel(packet);
 }
Esempio n. 5
0
 public SendDeliveryRunnable(SendPacket entity, float progress)
 {
     this.entity = entity;
     this.progress = progress;
 }
Esempio n. 6
0
            public void Run()
            {
                if (!entity.IsCanceled())
                {
                    entity.Listener.OnSendProgress(progress);
                }

                entity = null;
            }
Esempio n. 7
0
 internal void Cancel(SendPacket packet)
 {
     mSendDispatcher.Cancel(packet);
 }
Esempio n. 8
0
        /// <summary>
        ///  Send a Entity to queue
        /// </summary>
        /// <param name="packet">SendPacket</param>
        /// <returns>SendPacket</returns>
        public SendPacket Send(SendPacket packet)
        {
            packet.SetBlinkConn(this);

            mSendDispatcher.Send(packet);

            return packet;
        }
Esempio n. 9
0
 public void PostSendStart(SendPacket entity)
 {
     PostSend(new SendDeliveryRunnable(entity, 0, false));
 }
Esempio n. 10
0
 public void PostSendProgress(SendPacket entity, float progress)
 {
     PostSend(new SendDeliveryRunnable(entity, progress, false));
 }
Esempio n. 11
0
 public void PostSendEnd(SendPacket entity, bool isSuccess)
 {
     entity.SetSuccess(isSuccess);
     PostSend(new SendDeliveryRunnable(entity, 0, true));
 }
Esempio n. 12
0
 public SendDeliveryRunnable(SendPacket entity, float progress, bool isEnd)
 {
     this.entity = entity;
     this.progress = progress;
     this.isEnd = isEnd;
 }
Esempio n. 13
0
        public void PostSendProgress(SendPacket entity, float progress)
        {
            if (entity != null && entity.Listener != null)
            {
                PostQueue(() =>
                {
                    entity.Listener.OnSendProgress(progress);
                });

            }
        }