Class DnsClient
Used to manage a DNS connection to a server.
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Cosmos.System.Network.IPv4.UDP.DNS
Assembly: Cosmos.System2.dll
Syntax
public class DnsClient : UdpClient, IDisposable
Constructors
| Improve this Doc View SourceDnsClient()
Create new instance of the DnsClient class.
Declaration
public DnsClient()
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | Thrown on fatal error. |
System.ArgumentException | Thrown if UdpClient with localPort 53 exists. |
Methods
| Improve this Doc View SourceConnect(Address)
Connects to a client.
Declaration
public void Connect(Address address)
Parameters
Type | Name | Description |
---|---|---|
Address | address | The destination address. |
Receive(Int32)
Receives data from the DNS remote host.
Declaration
public Address Receive(int timeout = 5000)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | timeout | The timeout value - by default 5000ms. |
Returns
Type | Description |
---|---|
Address | The address corresponding to the previously specified domain name. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown on fatal error. |
SendAsk(String)
Sends a DNS query for the given domain name string.
Declaration
public void SendAsk(string url)
Parameters
Type | Name | Description |
---|---|---|
System.String | url | The domain name string to query the DNS for. |
Implements
System.IDisposable