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. } } Debug.Assert(_connection != null); _connection.AsyncRequestCanceled(outAsync, ex); }
public void AsyncRequestCanceled(OutgoingAsyncBase outAsync, Ice.LocalException ex) { lock (this) { if (_sendAsyncRequests.TryGetValue(outAsync, out int 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 o) { 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; } } } } }