public void Run() { if (!entity.IsCanceled()) { entity.Listener.OnSendProgress(progress); } entity = null; }
public void Run() { if (!entity.IsCanceled()) { if (status != null) { entity.DeliverProgress(status.total, status.cur); } else if (isEnd) { entity.DeliverEnd(); } else { entity.DeliverStart(); } } entity = null; status = null; }
/// <summary> /// Send next packet /// </summary> private void SendNext() { SendPacket packet = mPacket; mPacket = null; // Notify if (packet != null) { // Set Status mStatus = mCursor == mTotal; // End packet.SetSuccess(mStatus); packet.EndPacket(); // Post End mCursor = mTotal; NotifyProgress(); } // Take a request from the queue. mSending = mQueue.TryDequeue(out packet); if (mSending && packet != null) { // Cancel if (packet.IsCanceled()) { SendNext(); } else { // Set Packet mPacket = packet; // Start Send SendHead(); } } }