Hazelcast.Client.Spi.ClientInvocationService.CleanupInvocations C# (CSharp) Method

CleanupInvocations() private method

private CleanupInvocations ( ClientConnection connection ) : void
connection Hazelcast.Client.Connection.ClientConnection
return void
        private void CleanupInvocations(ClientConnection connection)
        {
            var keys = new List<long>();
            foreach (var entry in _invocations)
            {
                if (entry.Value.SentConnection == connection)
                {
                    keys.Add(entry.Key);
                }
            }
            foreach (var key in keys)
            {
                ClientInvocation invocation;
                if (_invocations.TryRemove(key, out invocation))
                {
                    var ex = _client.GetConnectionManager().Live
                        ? new TargetDisconnectedException(connection.GetAddress(), "connection was closed.")
                        : new HazelcastException("Client is shut down.");
                    HandleInvocationException(invocation, ex);
                }
            }
        }