protected override void UnsubscribeInternal(WcfClientChannel <IExMonServer4CommsServer> client)
        {
            ExMonServer4CommsServerProxy proxy = client as ExMonServer4CommsServerProxy;

            if (proxy != null)
            {
                proxy.Unsubscribe(_callbackType, FillSubscriptionEntity(_unsubscribeEntity));
            }
        }
Пример #2
0
        public void OnAfterUnsubcribed(WcfClientChannel <T> client)
        {
            ModuleProc PROC = new ModuleProc(this.DYN_MODULE_NAME, "OnAfterUnsubcribed");

            try
            {
                if (this.AfterUnsubcribed != null)
                {
                    this.AfterUnsubcribed(client);
                }
            }
            catch (Exception ex)
            {
                Log.Exception(PROC, ex);
            }
        }
Пример #3
0
        public void Unsubscribe(ref WcfClientChannel <T> client)
        {
            ModuleProc PROC = new ModuleProc(this.DYN_MODULE_NAME, "Unsubscribe");

            try
            {
                if (client != null)
                {
                    this.UnsubscribeInternal(client);
                    this.OnAfterUnsubcribed(client);
                }
            }
            catch (Exception ex)
            {
                if (!this.SkipLogException)
                {
                    Log.Exception(PROC, ex);
                }
            }
        }
        protected override void SubscribeInternal(WcfClientChannel <IExCommsServer> client)
        {
            ExCommsServerProxy proxy = client as ExCommsServerProxy;

            proxy.Subscribe(_callbackType, FillSubscriptionEntity(_subscribeEntity));
        }
        protected override void UnsubscribeInternal(WcfClientChannel <IExMonServer4MonClient> client)
        {
            ExMonServer4MonClientProxy proxy = client as ExMonServer4MonClientProxy;

            proxy.Unsubscribe(_callbackType, FillSubscriptionEntity(_unsubscribeEntity));
        }
Пример #6
0
        private WcfClientChannel <T> InitiateClient(ref WcfClientChannel <T> client, bool skipSubscribe)
        {
            ModuleProc PROC = new ModuleProc(this.DYN_MODULE_NAME, "InitiateClient");

            try
            {
                if (client == null ||
                    (!client.IsChannelAvailable))
                {
                    if (this.ExecutorService.IsShutdown)
                    {
                        return(null);
                    }

                    if (client != null)
                    {
                        if (!skipSubscribe)
                        {
                            this.Unsubscribe(ref client);
                        }
                        try
                        {
                            if (client.IsChannelAvailable)
                            {
                                client.Dispose();
                            }
                        }
                        catch { }
                        client = null;
                    }

                    try
                    {
                        client = this.CreateClient();
                    }
                    catch { client = null; }

                    if (client != null)
                    {
                        if (client is IWcfCallbackServiceClient)
                        {
                            ((IWcfCallbackServiceClient)client).SkipLogException = _skipLogException;
                        }
                        if (!skipSubscribe)
                        {
                            this.Subscribe(ref client);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                if (!this.SkipLogException)
                {
                    Log.Exception(PROC, ex);
                }
                client = null;
            }

            return(client);
        }
Пример #7
0
 protected abstract void UnsubscribeInternal(WcfClientChannel <T> client);