Exemplo n.º 1
0
        internal bool OpenListenerChannelInstance(IActivatedMessageQueue queue)
        {
            byte[] queueBlob = queue.ListenerChannelContext.Dehydrate();
            Debug.Print("ListenerAdapter[" + ProtocolName + "]::ListenerAdapter.OpenListenerChannelInstance(appPoolId:" + queue.App.AppPool.AppPoolId + " appKey:" + queue.ListenerChannelContext.AppKey + " queueId:" + queue.ListenerChannelContext.ListenerChannelId + ")");
            int hresult = OpenListenerChannelInstance(queue.App.AppPool.AppPoolId, queue.ListenerChannelContext.ListenerChannelId, queueBlob);

            if (hresult != 0)
            {
                if (DiagnosticUtility.ShouldTraceError)
                {
                    ListenerTraceUtility.TraceEvent(TraceEventType.Error, ListenerTraceCode.WasWebHostAPIFailed, SR.GetString(SR.TraceCodeWasWebHostAPIFailed),
                                                    new StringTraceRecord("HRESULT", SR.GetString(SR.TraceCodeWasWebHostAPIFailed,
                                                                                                  "WebhostOpenListenerChannelInstance", hresult.ToString(CultureInfo.CurrentCulture))), this, null);
                }
                if (TD.OpenListenerChannelInstanceFailedIsEnabled())
                {
                    TD.OpenListenerChannelInstanceFailed(this.EventTraceActivity, hresult.ToString(CultureInfo.CurrentCulture));
                }

                return(false);
            }

            return(true);
        }