Dart.PowerTCP.SslSockets Namespace > Dns Class : RetryInterval Property |
Gets or Sets a value that controls the interval in ms between retries on failed lookups.
[Visual Basic]
<CategoryAttribute("Behavior")>
<DescriptionAttribute("Gets or Sets a value that controls the interval in ms between retries on failed lookups.")>
<DefaultValueAttribute()>
Public Property RetryInterval As Integer
[C#]
[CategoryAttribute("Behavior")]
[DescriptionAttribute("Gets or Sets a value that controls the interval in ms between retries on failed lookups.")]
[DefaultValueAttribute()]
public int RetryInterval {get; set;}
[C++]
[CategoryAttribute("Behavior")]
[DescriptionAttribute("Gets or Sets a value that controls the interval in ms between retries on failed lookups.")]
[DefaultValueAttribute()]
public: __property int get_RetryInterval();
public: __property void set_RetryInterval(
int value
);
[C++/CLI]
[CategoryAttribute("Behavior")]
[DescriptionAttribute("Gets or Sets a value that controls the interval in ms between retries on failed lookups.")]
[DefaultValueAttribute()]
public:
property int RetryInterval {
int get();
void set (int value);
}
An integer representing the number of milliseconds to wait between retries. Defaults to 500 ms.
If Retries is a positive value and a lookup fails, the component will wait for the specified number of milliseconds before retrying the request.
Set to 0 if no interval is desired. Set to a higher value if the DNS server experiences overload.
The following example demonstrates using the Dns control to resolve a domain name.
[Visual Basic]
Private Sub ResolveTest()
Dns1.Servers.Add("206.64.128.5") 'Adds this server to list of DNS servers
Dns1.RotateServers = True 'Will always try next server in Dns1.Servers
Dns1.Retries = 2 'On failures, try an additional two times
Dns1.RetryInterval = 0 'Do not wait between retries
Dim result As System.Net.IPHostEntry = Dns1.GetHost("www.dart.com")
DisplayResult(result)
End Sub
Private Sub DisplayResult(ByVal result As System.Net.IPHostEntry)
' Display host name
Debug.WriteLine("Host name: " + result.HostName)
' Display addresses, if any
Dim add As System.Net.IPAddress
For Each add In result.AddressList
Debug.WriteLine("Address: " + add.ToString())
Next
' Display aliases, if any
Dim s As String
For Each s In result.Aliases
Debug.WriteLine("Aliases: " + s)
Next
End Sub
[C#]
private void ResolveTest()
{
dns1.Servers.Add("206.64.128.5"); 'Adds this server to list of
DNS servers
dns1.RotateServers = true; 'Will always try next server in Dns1.Servers
dns1.Retries = 2; 'On failures, try an additional two times
dns1.RetryInterval = 0; 'Do not wait between retries
System.Net.IPHostEntry result = dns1.GetHost("www.dart.com");
DisplayResult(result);
}
private void DisplayResult(System.Net.IPHostEntry result)
{
// Display host name
Debug.WriteLine("Host name: " + result.HostName);
// Display addresses, if any
foreach(System.Net.IPAddress add in result.AddressList)
Debug.WriteLine("Address: " + add.ToString());
// Display aliases, if any
foreach(string s in result.Aliases)
Debug.WriteLine("Aliases: " + s);
}
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
Send comments on this topic.
Documentation version 1.1.2.0.
© 2008 Dart Communications. All rights reserved.