Exemplo n.º 1
0
        public void FindAdapterById(string domainId, string adapterId, ILookupReplyPrx reply, Current current)
        {
            if (!domainId.Equals(_domainId))
            {
                return; // Ignore
            }

            bool       isReplicaGroup;
            IObjectPrx proxy = _registry.FindAdapter(adapterId, out isReplicaGroup);

            if (proxy != null)
            {
                //
                // Reply to the multicast request using the given proxy.
                //
                try
                {
                    reply.FoundAdapterByIdAsync(adapterId, proxy, isReplicaGroup);
                }
                catch (LocalException)
                {
                    // Ignore.
                }
            }
        }
Exemplo n.º 2
0
        public async ValueTask FindAdapterByIdAsync(
            string domainId,
            string adapterId,
            ILookupReplyPrx reply,
            Current current,
            CancellationToken cancel)
        {
            if (domainId != _domainId)
            {
                return; // Ignore
            }

            (IObjectPrx? proxy, bool isReplicaGroup) = _registryServant.FindAdapter(adapterId);
            if (proxy != null)
            {
                // Reply to the multicast request using the given proxy.
                try
                {
                    await reply.FoundAdapterByIdAsync(adapterId, proxy, isReplicaGroup, cancel : cancel).
                    ConfigureAwait(false);
                }
                catch (Exception ex)
                {
                    current.Communicator.Logger.Warning(
                        $"IceDiscovery failed to send foundAdapterById to `{reply}':\n{ex}");
                }
            }
        }