Esempio n. 1
0
        void CreateListenerChannelContext()
        {
            listenerChannelContext = new ListenerChannelContext(this.app.AppKey,
                Interlocked.Increment(ref listenerChannelIdCounter), Guid.NewGuid());

            listenerChannelIds[listenerChannelContext.ListenerChannelId] = this;
        }
Esempio n. 2
0
        void CreateListenerChannelContext()
        {
            listenerChannelContext = new ListenerChannelContext(this.app.AppKey,
                                                                Interlocked.Increment(ref listenerChannelIdCounter), Guid.NewGuid());

            listenerChannelIds[listenerChannelContext.ListenerChannelId] = this;
        }
Esempio n. 3
0
            public QueueMonitorGroup(ActivationService activationService, ListenerAdapter la, App app)
            {
                this.activationService = activationService;
                this.listenerAdapter   = la;
                this.app = app;
                this.startQueueInstanceCount = 1;
                this.listenerChannelContext  = new ListenerChannelContext(app.AppKey,
                                                                          Interlocked.Increment(ref queueIdCounter), Guid.Empty);

                this.pendingNotificationCount = 0;
                this.filter     = new ActivationBindingFilter(this, app.Path);
                this.retryTimer = new IOThreadTimer(new Action <object>(OnRetryTimer), null, false);
            }
        // Start per-process listening for messages
        public override void StartListenerChannel(IListenerChannelCallback listenerChannelCallback)
        {
            Debug.Print("BaseAppDomainProtocolHandler.StartListenerChannel()");
            if (listenerChannelCallback == null)
            {
                DiagnosticUtility.DebugAssert("listenerChannelCallback is null");
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperInternal(false);
            }

            this.listenerChannelCallback = listenerChannelCallback;

            int listenerChannelDataLength = listenerChannelCallback.GetBlobLength();
            byte[] listenerChannelData = new byte[listenerChannelDataLength];
            listenerChannelCallback.GetBlob(listenerChannelData, ref listenerChannelDataLength);
            Debug.Print("BaseAppDomainProtocolHandler.StartListenerChannel() GetBlob() contains " + listenerChannelDataLength + " bytes");

            listenerChannelContext = ListenerChannelContext.Hydrate(listenerChannelData);

            Debug.Print("BaseAppDomainProtocolHandler.StartListenerChannel() calling OnStart()");
#if DEBUG
            // Debug.Print("BaseAppDomainProtocolHandler.StartListenerChannel() waiting for you to attach the debugger to " + Process.GetCurrentProcess().ProcessName + " Pid: " + Process.GetCurrentProcess().Id);
            // for (int sleepCount = 0; sleepCount < 30 && !Debugger.IsAttached && !ListenerUnsafeNativeMethods.IsDebuggerPresent(); sleepCount++) { Thread.Sleep(500); } Debugger.Break();
#endif
            try
            {
                OnStart();

                listenerChannelCallback.ReportStarted();
                Debug.Print("BaseAppDomainProtocolHandler.StartListenerChannel() called ReportStarted()");
            }
            catch (CommunicationException exception)
            {
                Debug.Print("BaseAppDomainProtocolHandler.StartListenerChannel() failed in OnStart():\r\n" + exception);
                DiagnosticUtility.EventLog.LogEvent(TraceEventType.Error,
                    (ushort)System.Runtime.Diagnostics.EventLogCategory.WebHost,
                    (uint)System.Runtime.Diagnostics.EventLogEventId.WebHostFailedToListen,
                    listenerChannelContext.AppKey,
                    this.protocolId,
                    TraceUtility.CreateSourceString(this),
                    exception.ToString());

                throw;
            }
        }
Esempio n. 5
0
            public QueueMonitorGroup(ActivationService activationService, ListenerAdapter la, App app)
            {
                this.activationService = activationService;
                this.listenerAdapter = la;
                this.app = app;
                this.startQueueInstanceCount = 1;
                this.listenerChannelContext = new ListenerChannelContext(app.AppKey,
                    Interlocked.Increment(ref queueIdCounter), Guid.Empty);

                this.pendingNotificationCount = 0;
                this.filter = new ActivationBindingFilter(this, app.Path);
                this.retryTimer = new IOThreadTimer(new Action<object>(OnRetryTimer), null, false);
            }