Class DHCPClient
Used to manage the DHCP 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.DHCP
Assembly: Cosmos.System2.dll
Syntax
public class DHCPClient : UdpClient, IDisposable
Constructors
| Improve this Doc View SourceDHCPClient()
Initializes a new instance of the DHCPClient class.
Declaration
public DHCPClient()
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | Thrown on fatal error. |
System.ArgumentException | Thrown if UdpClient with localPort 53 exists. |
Methods
| Improve this Doc View SourceDHCPServerAddress(NetworkDevice)
Gets the IP address of the DHCP server.
Declaration
public static Address DHCPServerAddress(NetworkDevice networkDevice)
Parameters
Type | Name | Description |
---|---|---|
NetworkDevice | networkDevice |
Returns
Type | Description |
---|---|
Address |
SendDiscoverPacket()
Send a packet to find the DHCP server and inform the host that we are requesting a new IP address.
Declaration
public int SendDiscoverPacket()
Returns
Type | Description |
---|---|
System.Int32 | The amount of time elapsed, or -1 if a timeout has been reached. |
SendReleasePacket()
Sends a packet to the DHCP server in order to make the address available again.
Declaration
public void SendReleasePacket()
Implements
System.IDisposable