Ejemplo n.º 1
0
        private async Task <DnsMessage> DoQuery(DnsMessage dnsMessage, string ipEndPoint)
        {
            var upstreamResponse = await _strategyManager
                                   .ResolveAsync(dnsMessage, ipEndPoint, _cancellationTokenSource.Token)
                                   .ConfigureAwait(false);

            if (upstreamResponse?.AnswerRecords != null &&
                upstreamResponse.AnswerRecords.Any())
            {
                return(upstreamResponse);
            }

            return(await Task.FromResult((DnsMessage)null).ConfigureAwait(false));
        }