void OnCommServerCallbackHelper_AfterUnsubscribed(IExMonServer4MonProcessorCallback callback, object state)
 {
     ExCommsServerSubscribeEntityBase callbackEntity = state as ExCommsServerSubscribeEntityBase;
     if (callbackEntity != null)
     {
         string ipAddress = callbackEntity.Entity.IPAddress;
         if (_monProcessorCallbacks.ContainsKey(ipAddress))
         {
             _monProcessorCallbacks[ipAddress] = null;
         }
     }
 }
예제 #2
0
        void OnCommServerCallbackHelper_AfterUnsubscribed(IExMonServer4MonProcessorCallback callback, object state)
        {
            ExCommsServerSubscribeEntityBase callbackEntity = state as ExCommsServerSubscribeEntityBase;

            if (callbackEntity != null)
            {
                string ipAddress = callbackEntity.Entity.IPAddress;
                if (_monProcessorCallbacks.ContainsKey(ipAddress))
                {
                    _monProcessorCallbacks[ipAddress] = null;
                }
            }
        }
        public static ExMonServer4MonProcessorCallbackProxy Get(IExecutorService executorService,
                                                                ExMonServer4MonProcessorCallbackTypes callbackType,
                                                                IExMonServer4MonProcessorCallback callbackInstance,
                                                                int timeoutInMilliseconds, WaitHandle canListen)
        {
            using (ILogMethod method = Log.LogMethod("ExMonServer4MonProcessorProxyFactory", "Get"))
            {
                ExMonServer4MonProcessorCallbackProxy result = default(ExMonServer4MonProcessorCallbackProxy);

                try
                {
                    result = new ExMonServer4MonProcessorCallbackProxy(executorService, callbackType, callbackInstance, timeoutInMilliseconds, canListen);
                }
                catch (Exception ex)
                {
                    method.Exception(ex);
                }

                return(result);
            }
        }
        public static ExMonServer4MonProcessorProxy Get(IExMonServer4MonProcessorCallback callbackInstance)
        {
            using (ILogMethod method = Log.LogMethod("ExMonServer4MonProcessorProxyFactory", "Get"))
            {
                ExMonServer4MonProcessorProxy result = default(ExMonServer4MonProcessorProxy);

                try
                {
                    result = ExCommsGenericProxy.GetService <ExMonServer4MonProcessorProxy, IExMonServer4MonProcessor>(
                        (i) =>
                    {
                        if (callbackInstance != null)
                        {
                            return(new ExMonServer4MonProcessorProxy(i, callbackInstance));
                        }
                        else
                        {
                            return(new ExMonServer4MonProcessorProxy(i));
                        }
                    },
                        (b, u) =>
                    {
                        if (callbackInstance != null)
                        {
                            return(new ExMonServer4MonProcessorProxy(callbackInstance, b, u, null));
                        }
                        else
                        {
                            return(new ExMonServer4MonProcessorProxy(b, u));
                        }
                    });
                }
                catch (Exception ex)
                {
                    method.Exception(ex);
                }

                return(result);
            }
        }