Exemplo n.º 1
0
        public async ValueTask FindObjectByIdAsync(
            string domainId,
            Identity id,
            string?facet,
            IFindObjectByIdReplyPrx reply,
            Current current,
            CancellationToken cancel)
        {
            if (domainId != _domainId)
            {
                return; // Ignore
            }

            if (await _registryServant.FindObjectAsync(id, facet, cancel).ConfigureAwait(false) is IObjectPrx proxy)
            {
                // Reply to the multicast request using the given proxy.
                try
                {
                    await reply.FoundObjectByIdAsync(id, proxy, cancel : cancel).ConfigureAwait(false);
                }
                catch (Exception ex)
                {
                    current.Communicator.Logger.Warning(
                        $"{_pluginName} failed to send foundObjectById to `{reply}':\n{ex}");
                }
            }
        }
Exemplo n.º 2
0
        public async ValueTask FindObjectByIdAsync(
            string domainId,
            Identity id,
            string?facet,
            IFindObjectByIdReplyPrx reply,
            Current current,
            CancellationToken cancel)
        {
            if (domainId != _domainId)
            {
                return; // Ignore
            }

            if (await _registryServant.FindObjectAsync(id, facet, cancel).ConfigureAwait(false) is IObjectPrx proxy)
            {
                // Reply to the multicast request using the given proxy.
                try
                {
                    if (reply.InvocationMode == InvocationMode.Datagram)
                    {
                        reply = reply.Clone(preferNonSecure: NonSecure.Always);
                    }
                    await reply.FoundObjectByIdAsync(id, proxy, cancel : cancel).ConfigureAwait(false);
                }
                catch (Exception ex)
                {
                    current.Communicator.Logger.Warning(
                        $"Ice discovery failed to send foundObjectById to `{reply}':\n{ex}");
                }
            }
        }