Beispiel #1
0
        public void asyncRequestCanceled(OutgoingAsyncBase outAsync, Ice.LocalException ex)
        {
            lock (this)
            {
                if (_exception != null)
                {
                    return; // The request has been notified of a failure already.
                }

                if (!initialized())
                {
                    LinkedListNode <ProxyOutgoingAsyncBase> p = _requests.First;
                    while (p != null)
                    {
                        if (p.Value == outAsync)
                        {
                            _requests.Remove(p);
                            if (outAsync.exception(ex))
                            {
                                outAsync.invokeExceptionAsync();
                            }
                            return;
                        }
                        p = p.Next;
                    }
                    Debug.Assert(false); // The request has to be queued if it timed out and we're not initialized yet.
                }
            }
            _connection.asyncRequestCanceled(outAsync, ex);
        }
Beispiel #2
0
 public void asyncRequestCanceled(OutgoingAsyncBase outAsync, Ice.LocalException ex)
 {
     lock (this)
     {
         int requestId;
         if (_sendAsyncRequests.TryGetValue(outAsync, out requestId))
         {
             if (requestId > 0)
             {
                 _asyncRequests.Remove(requestId);
             }
             _sendAsyncRequests.Remove(outAsync);
             if (outAsync.exception(ex))
             {
                 outAsync.invokeExceptionAsync();
             }
             _adapter.decDirectCount(); // invokeAll won't be called, decrease the direct count.
             return;
         }
         if (outAsync is OutgoingAsync)
         {
             OutgoingAsync o = (OutgoingAsync)outAsync;
             Debug.Assert(o != null);
             foreach (KeyValuePair <int, OutgoingAsyncBase> e in _asyncRequests)
             {
                 if (e.Value == o)
                 {
                     _asyncRequests.Remove(e.Key);
                     if (outAsync.exception(ex))
                     {
                         outAsync.invokeExceptionAsync();
                     }
                     return;
                 }
             }
         }
     }
 }