Class UDPPacket
Represents a UDP packet.
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)
Namespace: Cosmos.System.Network.IPv4.UDP
Assembly: Cosmos.System2.dll
Syntax
public class UDPPacket : IPPacket
Constructors
| Improve this Doc View SourceUDPPacket(Address, Address, UInt16, UInt16, Byte[])
Initializes a new instance of the UDPPacket class.
Declaration
public UDPPacket(Address source, Address dest, ushort srcPort, ushort destPort, byte[] data)
Parameters
| Type | Name | Description |
|---|---|---|
| Address | source | The source address. |
| Address | dest | The destination address. |
| System.UInt16 | srcPort | The source port. |
| System.UInt16 | destPort | The destination port. |
| System.Byte[] | data | The data array. |
Exceptions
| Type | Condition |
|---|---|
| System.OverflowException | Thrown if data array length is greater than Int32.MaxValue. |
| System.ArgumentException | Thrown if RawData is invalid or null. |
UDPPacket(Address, Address, UInt16, UInt16, UInt16)
Declaration
public UDPPacket(Address source, Address dest, ushort srcport, ushort destport, ushort datalength)
Parameters
| Type | Name | Description |
|---|---|---|
| Address | source | |
| Address | dest | |
| System.UInt16 | srcport | |
| System.UInt16 | destport | |
| System.UInt16 | datalength |
UDPPacket(Address, Address, UInt16, UInt16, UInt16, MACAddress)
Declaration
public UDPPacket(Address source, Address dest, ushort srcport, ushort destport, ushort datalength, MACAddress destmac)
Parameters
| Type | Name | Description |
|---|---|---|
| Address | source | |
| Address | dest | |
| System.UInt16 | srcport | |
| System.UInt16 | destport | |
| System.UInt16 | datalength | |
| MACAddress | destmac |
UDPPacket(Byte[])
Initializes a new instance of the UDPPacket class.
Declaration
public UDPPacket(byte[] rawData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | rawData | The raw data. |
Properties
| Improve this Doc View SourceDestinationPort
Gets the destination port.
Declaration
public ushort DestinationPort { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt16 |
SourcePort
Gets the source port.
Declaration
public ushort SourcePort { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt16 |
UDPDataLength
Get UDP data length of the packet.
Declaration
public ushort UDPDataLength { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt16 |
UDPLength
Gets the UDP length of the packet.
Declaration
public ushort UDPLength { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt16 |
Methods
| Improve this Doc View SourceInitializeFields()
Declaration
protected override void InitializeFields()
Overrides
| Improve this Doc View SourceToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String |