Compartilhar via


ServicePointManager.EnableDnsRoundRobin Propriedade

Definição

Obtém ou define um valor que indica se uma resolução de DNS (serviço de nomes de domínio) gira entre os endereços IP (Protocolo IP) aplicáveis.

public:
 static property bool EnableDnsRoundRobin { bool get(); void set(bool value); };
public static bool EnableDnsRoundRobin { get; set; }
static member EnableDnsRoundRobin : bool with get, set
Public Shared Property EnableDnsRoundRobin As Boolean

Valor da propriedade

false se uma resolução DNS sempre retorna o primeiro endereço IP para um determinado host; caso contrário, true. O padrão é false.

Exemplos

O exemplo de código a seguir define essa propriedade.

ServicePointManager::UseNagleAlgorithm = true;
ServicePointManager::Expect100Continue = true;
ServicePointManager::CheckCertificateRevocationList = true;
ServicePointManager::DefaultConnectionLimit =
    ServicePointManager::DefaultPersistentConnectionLimit;
ServicePointManager::EnableDnsRoundRobin = true;
ServicePointManager::DnsRefreshTimeout = 4*60*1000; // 4 minutes
ServicePointManager.UseNagleAlgorithm = true;
ServicePointManager.Expect100Continue = true;
ServicePointManager.CheckCertificateRevocationList = true;
ServicePointManager.DefaultConnectionLimit = ServicePointManager.DefaultPersistentConnectionLimit;
ServicePointManager.EnableDnsRoundRobin = true;
ServicePointManager.DnsRefreshTimeout = 4*60*1000; // 4 minutes
ServicePointManager.UseNagleAlgorithm = True
ServicePointManager.Expect100Continue = True
ServicePointManager.CheckCertificateRevocationList = True
ServicePointManager.DefaultConnectionLimit = _
    ServicePointManager.DefaultPersistentConnectionLimit
ServicePointManager.EnableDnsRoundRobin = True
ServicePointManager.DnsRefreshTimeout = 4*60*1000

Comentários

Quando mais de um endereço IP está associado a um nome de host, uma resolução DNS normalmente retorna apenas o primeiro endereço IP. Se você definir essa propriedade como true, as resoluções DNS subsequentes percorrerão todos os endereços IP disponíveis para um host específico. Essa opção é útil quando um serviço usa o DNS como um mecanismo de balanceamento de carga entre servidores ou clusters de servidor.

Aplica-se a

Confira também