Class UDPPacket
UDPPacket class.
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[])
Create 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 | Source address. |
Address | dest | Destination address. |
System.UInt16 | srcPort | Source port. |
System.UInt16 | destPort | Destination port. |
System.Byte[] | data | 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[])
Create new instance of the UDPPacket class.
Declaration
public UDPPacket(byte[] rawData)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | rawData | Raw data. |
Properties
| Improve this Doc View SourceDestinationPort
Get destination port.
Declaration
public ushort DestinationPort { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
SourcePort
Get source port.
Declaration
public ushort SourcePort { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
UDP_DataLength
Get UDP data lenght.
Declaration
public ushort UDP_DataLength { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
UDP_Length
Get UDP length.
Declaration
public ushort UDP_Length { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
Methods
| Improve this Doc View SourceInitFields()
Init UDPPacket fields.
Declaration
protected override void InitFields()
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown if RawData is invalid or null. |
ToString()
To string.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | string value. |