Пример #1
0
        protected virtual bool ExceptionImpl(Ice.Exception ex)
        {
            lock (this)
            {
                _ex = ex;
                if (ChildObserver != null)
                {
                    ChildObserver.Failed(ex.ice_id());
                    ChildObserver.Detach();
                    ChildObserver = null;
                }
                _cancellationHandler = null;

                if (Observer != null)
                {
                    Observer.Failed(ex.ice_id());
                }
                bool invoke = _completionCallback.HandleException(ex, this);
                if (!invoke && Observer != null)
                {
                    Observer.Detach();
                    Observer = null;
                }
                return(invoke);
            }
        }
Пример #2
0
        public override bool Exception(Ice.Exception exc)
        {
            if (ChildObserver != null)
            {
                ChildObserver.Failed(exc.ice_id());
                ChildObserver.Detach();
                ChildObserver = null;
            }

            CachedConnection = null;
            if (Proxy.IceReference.GetInvocationTimeout() == -2)
            {
                Communicator.Timer().Cancel(this);
            }

            //
            // NOTE: at this point, synchronization isn't needed, no other threads should be
            // calling on the callback.
            //
            try
            {
                //
                // It's important to let the retry queue do the retry even if
                // the retry interval is 0. This method can be called with the
                // connection locked so we can't just retry here.
                //
                Communicator.AddRetryTask(this, Proxy.IceHandleException(exc, Handler, Mode, _sent, ref _cnt));
                return(false);
            }
            catch (Ice.Exception ex)
            {
                return(ExceptionImpl(ex)); // No retries, we're done
            }
        }