ServicePointManager.EnableDnsRoundRobin Właściwość

Definicja

Pobiera lub ustawia wartość, która wskazuje, czy rozpoznawanie usługi nazw domen (DNS) obraca się między odpowiednimi adresami IP.

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

Wartość właściwości

false jeśli rozpoznawanie nazw DNS zawsze zwraca pierwszy adres IP dla określonego hosta; w przeciwnym razie true. Wartość domyślna to false.

Przykłady

Poniższy przykład kodu ustawia tę właściwość.

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

Uwagi

Gdy więcej niż jeden adres IP jest skojarzony z nazwą hosta, rozpoznawanie nazw DNS zwykle zwraca tylko pierwszy adres IP. Jeśli ustawisz tę właściwość na truewartość , kolejne rozwiązania DNS będą przechodzić przez wszystkie dostępne adresy IP dla określonego hosta. Ta opcja jest przydatna, gdy usługa używa systemu DNS jako mechanizmu równoważenia obciążenia między serwerami lub klastrami serwerów.

Dotyczy

Zobacz też