예제 #1
0
        public async ValueTask FindAdapterByIdAsync(
            string domainId,
            string adapterId,
            IFindAdapterByIdReplyPrx 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(
                        $"{_pluginName} failed to send foundAdapterById to `{reply}':\n{ex}");
                }
            }
        }
예제 #2
0
파일: Lookup.cs 프로젝트: mreinart/ice
        public async ValueTask FindAdapterByIdAsync(
            string domainId,
            string adapterId,
            IFindAdapterByIdReplyPrx 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
                {
                    if (reply.InvocationMode == InvocationMode.Datagram)
                    {
                        reply = reply.Clone(preferNonSecure: NonSecure.Always);
                    }
                    await reply.FoundAdapterByIdAsync(adapterId, proxy, isReplicaGroup, cancel : cancel).
                    ConfigureAwait(false);
                }
                catch (Exception ex)
                {
                    current.Communicator.Logger.Warning(
                        $"Ice discovery failed to send foundAdapterById to `{reply}':\n{ex}");
                }
            }
        }