Class ICMPClient
Used to manage the ICMP connection to a client.
Inheritance
System.Object
ICMPClient
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
Assembly: Cosmos.System2.dll
Syntax
public class ICMPClient : IDisposable
Constructors
| Improve this Doc View SourceICMPClient()
Initializes a new instance of the ICMPClient class.
Declaration
public ICMPClient()
Fields
| Improve this Doc View Sourcedestination
The destination address.
Declaration
protected Address destination
Field Value
Type | Description |
---|---|
Address |
rxBuffer
The RX buffer queue.
Declaration
protected Queue<ICMPPacket> rxBuffer
Field Value
Type | Description |
---|---|
System.Collections.Generic.Queue<ICMPPacket> |
Methods
| Improve this Doc View SourceClose()
Closes the active connection.
Declaration
public void Close()
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | Thrown on fatal error. |
Connect(Address)
Connects to the given client.
Declaration
public void Connect(Address dest)
Parameters
Type | Name | Description |
---|---|---|
Address | dest | The destination address. |
Dispose()
Declaration
public void Dispose()
Receive(ref EndPoint, Int32)
Receives data from the remote host.
Declaration
public int Receive(ref EndPoint source, int timeout = 5000)
Parameters
Type | Name | Description |
---|---|---|
EndPoint | source | The source end point. |
System.Int32 | timeout | The timeout value; by default, 5000ms. |
Returns
Type | Description |
---|---|
System.Int32 | The address from the domain name. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown on fatal error. |
ReceiveData(ICMPPacket)
Receives data from the given packet.
Declaration
public void ReceiveData(ICMPPacket packet)
Parameters
Type | Name | Description |
---|---|---|
ICMPPacket | packet | The packet to receive. |
Exceptions
Type | Condition |
---|---|
System.OverflowException | Thrown on fatal error. |
System.IO.IOException | Thrown on IO error. |
SendEcho()
Sends an ICMP echo.
Declaration
public void SendEcho()
Implements
System.IDisposable