// Token: 0x06001400 RID: 5120 RVA: 0x00073D14 File Offset: 0x00071F14 protected override void DrainNotifications(ConcurrentDictionary <Guid, PushNotificationContext> notificationContexts) { MailboxNotificationBatch mailboxNotificationBatch = new MailboxNotificationBatch(); foreach (Guid guid in notificationContexts.Keys) { if (base.CheckCancellation()) { return; } PushNotificationContext pushNotificationContext = notificationContexts[guid]; MailboxNotification notification = this.CreateMailboxNotification(guid, pushNotificationContext); mailboxNotificationBatch.Add(notification); NotificationTracker.ReportCreated(notification, pushNotificationContext.OriginalTime); PushNotificationHelper.LogNotificationBatchEntry(guid, notification); } if (!mailboxNotificationBatch.IsEmpty) { ExTraceGlobals.PushNotificationAssistantTracer.TraceDebug <int>((long)this.GetHashCode(), "PushNotificationBatchManager.DrainNotifications: Ready to send notification batch, size:'{0}'.", mailboxNotificationBatch.Count); if (base.CheckCancellation()) { return; } PushNotificationBatchManager.notificationsPerBatchCounter.AddSample((long)mailboxNotificationBatch.Count); this.SendPublishNotificationRequest(mailboxNotificationBatch); } notificationContexts.Clear(); }
// Token: 0x06001401 RID: 5121 RVA: 0x00073E68 File Offset: 0x00072068 private void SendPublishNotificationRequest(MailboxNotificationBatch batch) { AverageTimeCounter requestCounter = new AverageTimeCounter(PushNotificationsAssistantPerfCounters.AveragePublishingRequestProcessing, PushNotificationsAssistantPerfCounters.AveragePublishingRequestProcessingBase, true); this.publisherClient.BeginPublishNotifications(batch, delegate(IAsyncResult asyncResult) { object asyncState = asyncResult.AsyncState; try { this.publisherClient.EndPublishNotifications(asyncResult); PushNotificationsMonitoring.PublishSuccessNotification("SendPublishNotification", ""); } catch (Exception exception) { PushNotificationsAssistantPerfCounters.PublishingRequestErrors.Increment(); PushNotificationHelper.LogSendPublishNotificationException(exception, null); } finally { requestCounter.Stop(); } }, requestCounter); }
// Token: 0x06001434 RID: 5172 RVA: 0x000749A4 File Offset: 0x00072BA4 internal static void LogSendPublishNotificationException(Exception exception, MailboxNotificationBatch batch = null) { PushNotificationsMonitoring.PublishFailureNotification("SendPublishNotification", "", ""); ExTraceGlobals.PushNotificationAssistantTracer.TraceError <string, string>(0L, "An error '{0}'-'{1}' was generated when publishing a notification batch.", exception.ToString(), (exception.InnerException != null) ? exception.InnerException.ToString() : string.Empty); PushNotificationsCrimsonEvents.SendPublishNotificationException.LogPeriodic <string>(exception.Message, CrimsonConstants.DefaultLogPeriodicSuppressionInMinutes, exception.ToTraceString()); if (batch != null && batch.Notifications != null) { foreach (MailboxNotification notification in batch.Notifications) { NotificationTracker.ReportDropped(notification, exception.ToTraceString()); } } }