Example #1
0
        protected Application()
        {
            BatchMode = MessageBatchMode.PerTarget;

            Identifier            = Guid.NewGuid();
            _incomingMessageQueue = new IncomingMessageQueue(
                messageSet => _synchronizationContext.Send(nothing => DoProcessMessages(messageSet), null));
        }
Example #2
0
        internal void InternalStart(StartApplicationRequest request)
        {
            try
            {
                ProcessMetaInfo(request.MetaInformation);
                AuthenticateUser(request);
                _synchronizationContext = new WebSynchronizationContext(this);
                _synchronizationContext.Send(nothing => DoStart(request), null);
            }
            catch (Exception)
            {
                Logout();
                DisposeMembers();
                throw;
            }

            lock (_syncLock)
            {
                //DoStart can call Stop.
                if (_stop)
                {
                    return;
                }
            }

            _timer = new System.Threading.Timer(OnTimer, null, TimerInterval, TimerInterval);
        }