/** * 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); }
internal void Cancel(SendPacket packet) { //mSendQueue.(entity); }
public void PostSendProgress(SendPacket entity, float progress) { if (entity != null && entity.Listener != null) PostQueue(new SendDeliveryRunnable(entity, progress)); }
internal void Cancel(SendPacket packet) { mSendDispatcher.Cancel(packet); }
public SendDeliveryRunnable(SendPacket entity, float progress) { this.entity = entity; this.progress = progress; }
public void Run() { if (!entity.IsCanceled()) { entity.Listener.OnSendProgress(progress); } entity = null; }
internal void Cancel(SendPacket packet) { mSendDispatcher.Cancel(packet); }
/// <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; }
public void PostSendStart(SendPacket entity) { PostSend(new SendDeliveryRunnable(entity, 0, false)); }
public void PostSendProgress(SendPacket entity, float progress) { PostSend(new SendDeliveryRunnable(entity, progress, false)); }
public void PostSendEnd(SendPacket entity, bool isSuccess) { entity.SetSuccess(isSuccess); PostSend(new SendDeliveryRunnable(entity, 0, true)); }
public SendDeliveryRunnable(SendPacket entity, float progress, bool isEnd) { this.entity = entity; this.progress = progress; this.isEnd = isEnd; }
public void PostSendProgress(SendPacket entity, float progress) { if (entity != null && entity.Listener != null) { PostQueue(() => { entity.Listener.OnSendProgress(progress); }); } }