示例#1
0
 internal static bool ShouldIgnoreRequest(RequestContext requestContext, IMailboxContext userContext)
 {
     return(PendingRequestEventHandler.IsObsoleteRequest(requestContext, userContext));
 }
示例#2
0
        internal IAsyncResult BeginSendNotification(AsyncCallback callback, object extraData, PendingRequestEventHandler pendingRequestHandler, bool hierarchySubscriptionActive, string channelId)
        {
            bool flag = this.lockTracker.SetPipeAvailable(false);

            ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "[PendingRequestChannel.BeginSendNotification] Setting the pipe to AVAILABLE");
            try
            {
                this.pendingRequestEventHandler = pendingRequestHandler;
                this.asyncResult = new OwaAsyncResult(callback, extraData, channelId);
                try
                {
                    this.response = (ChunkedHttpResponse)extraData;
                    this.WriteIsRequestAlive(true);
                    this.notificationMark = 0L;
                    if (!hierarchySubscriptionActive)
                    {
                        ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "[PendingRequestChannel.BeginSendNotification] hierarchySubscriptionActive is false");
                        this.WriteReinitializeSubscriptions();
                    }
                    this.disposePendingRequest = false;
                }
                finally
                {
                    flag = !this.lockTracker.TryReleaseLock();
                }
                if (flag)
                {
                    this.WriteNotification(true);
                }
                this.startPendingRequestTime = DateTime.UtcNow.Ticks;
                this.lastDisconnectedTime    = 0L;
                if (this.pendingRequestAliveTimer == null)
                {
                    this.pendingRequestAliveTimer = new Timer(new TimerCallback(this.ElapsedConnectionAliveTimeout), null, 40000, 40000);
                }
                if (this.accountValidationTimer == null && this.response.AccountValidationContext != null)
                {
                    this.accountValidationTimer = new Timer(new TimerCallback(this.AccountValidationTimerCallback), null, 300000, 300000);
                }
            }
            catch (Exception e)
            {
                this.HandleException(e, true);
            }
            return(this.asyncResult);
        }