コード例 #1
0
ファイル: Lookup.cs プロジェクト: principleWindows/ice
        public async ValueTask ResolveAdapterIdAsync(
            string domainId,
            string adapterId,
            IResolveAdapterIdReplyPrx reply,
            Current current,
            CancellationToken cancel)
        {
            if (domainId != _domainId)
            {
                return; // Ignore
            }

            (IReadOnlyList <EndpointData> endpoints, bool isReplicaGroup) = _registryServant.ResolveAdapterId(adapterId);
            if (endpoints.Count > 0)
            {
                try
                {
                    await reply.FoundAdapterIdAsync(endpoints, isReplicaGroup, cancel : cancel).ConfigureAwait(false);
                }
                catch (Exception ex)
                {
                    current.Communicator.Logger.Warning(
                        $"{_pluginName} failed to send foundAdapterId to `{reply}':\n{ex}");
                }
            }
        }
コード例 #2
0
ファイル: Lookup.cs プロジェクト: mreinart/ice
        public async ValueTask ResolveAdapterIdAsync(
            string domainId,
            string adapterId,
            IResolveAdapterIdReplyPrx reply,
            Current current,
            CancellationToken cancel)
        {
            if (domainId != _domainId)
            {
                return; // Ignore
            }

            (IReadOnlyList <EndpointData> endpoints, bool isReplicaGroup) = _registryServant.ResolveAdapterId(adapterId);
            if (endpoints.Count > 0)
            {
                try
                {
                    if (reply.InvocationMode == InvocationMode.Datagram)
                    {
                        reply = reply.Clone(preferNonSecure: NonSecure.Always);
                    }
                    await reply.FoundAdapterIdAsync(endpoints, isReplicaGroup, cancel : cancel).ConfigureAwait(false);
                }
                catch (Exception ex)
                {
                    current.Communicator.Logger.Warning(
                        $"Ice discovery failed to send foundAdapterId to `{reply}':\n{ex}");
                }
            }
        }