Class DnsClient
DnsClient class. Used to manage the 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 (contact support). |
System.ArgumentException | Thrown if UdpClient with localPort 53 exists. |
Methods
| Improve this Doc View SourceConnect(Address)
Connect to client.
Declaration
public void Connect(Address address)
Parameters
Type | Name | Description |
---|---|---|
Address | address |
Receive(Int32)
Receive data
Declaration
public Address Receive(int timeout = 5000)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | timeout | timeout value, default 5000ms |
Returns
Type | Description |
---|---|
Address | Address from Domain Name |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown on fatal error (contact support). |
SendAsk(String)
Send DNS Ask for Domain Name string
Declaration
public void SendAsk(string url)
Parameters
Type | Name | Description |
---|---|---|
System.String | url | Domain Name string. |
Implements
System.IDisposable