示例#1
0
        public async ValueTask ResolveWellKnownProxyAsync(
            string domainId,
            Identity identity,
            string facet,
            IResolveWellKnownProxyReplyPrx reply,
            Current current,
            CancellationToken cancel)
        {
            if (domainId != _domainId)
            {
                return; // Ignore
            }

            string adapterId =
                await _registryServant.ResolveWellKnownProxyAsync(identity, facet, cancel).ConfigureAwait(false);

            if (adapterId.Length > 0)
            {
                try
                {
                    await reply.FoundWellKnownProxyAsync(adapterId, cancel : cancel).ConfigureAwait(false);
                }
                catch (Exception ex)
                {
                    current.Communicator.Logger.Warning(
                        $"{_pluginName} failed to send foundWellKnownProxy to `{reply}':\n{ex}");
                }
            }
        }
示例#2
0
文件: Lookup.cs 项目: mreinart/ice
        public async ValueTask ResolveWellKnownProxyAsync(
            string domainId,
            Identity identity,
            string facet,
            IResolveWellKnownProxyReplyPrx reply,
            Current current,
            CancellationToken cancel)
        {
            if (domainId != _domainId)
            {
                return; // Ignore
            }

            string adapterId =
                await _registryServant.ResolveWellKnownProxyAsync(identity, facet, cancel).ConfigureAwait(false);

            if (adapterId.Length > 0)
            {
                try
                {
                    if (reply.InvocationMode == InvocationMode.Datagram)
                    {
                        reply = reply.Clone(preferNonSecure: NonSecure.Always);
                    }
                    await reply.FoundWellKnownProxyAsync(adapterId, cancel : cancel).ConfigureAwait(false);
                }
                catch (Exception ex)
                {
                    current.Communicator.Logger.Warning(
                        $"Ice discovery failed to send foundWellKnownProxy to `{reply}':\n{ex}");
                }
            }
        }