Halyri - Udp-client
0.9.1
|
Class representing a subsequent portion of MediaPacket. MediaContinuationPackets are used to transfer the data that remains after data worth first MTU is taken from the MediaPacket and costructed into a MediaHeaderPacket. The combination of a MediaHeaderPacket and the subsequent MediaContinuationPackets is a transfer sequence. More...
Inherits INetworkPacket.
Public Member Functions | |
MediaContinuationPacket () | |
Initializes a new MediaContinuationPacket with no parameters. More... | |
MediaContinuationPacket (byte[] guid, Int32 packetOrderNumber, Int32 packetCount, byte[] payload, Int64 sequenceNumber) | |
Initializes a new MediaContinuationPacket instance that has the specified source Guid, packet order number, packet count, payload data and sequence number. More... | |
MediaContinuationPacket (byte[] guid, Int32 packetOrderNumber, Int32 packetCount, byte[] payload) | |
Initializes a new MediaContinuationPacket instance that has the specified source Guid, packet order number, packet count and payload data. The sequence number must be provided prior any calls to the parameterless GetBytes. More... | |
byte[] | GetBytes (long sequenceNumber) |
void | FromBytes (byte[] packetBytes) |
Sets the state of this packet from the provided array of bytes. If the array does not containt a valid byte representation of this type of packet, throws an ArgumentException. More... | |
byte[] | GetBytes () |
Converts this packet to a byte array for network transfer. The sequence number specified in the packet will be used. More... | |
Public Member Functions inherited from INetworkPacket | |
byte[] | GetBytes (Int64 sequence) |
Converts this packet to a byte array for network transfer. The specified seqeuence number will be used in the packet header. More... | |
Public Attributes | |
const int | HeaderLengthInOctets = 33 |
const byte | PacketId = 1 |
Properties | |
string | SourceGuid [get] |
String represenstation of the Guid identifying the sender More... | |
Int64 | Sequence [get, set] |
Packet sequence number More... | |
Int32 | TotalPacketCount [get] |
Total number of packets in the related transfer sequence. More... | |
Int32 | PacketNumber [get] |
Number of this packet in the related transfer sequence. More... | |
byte[] | PayloadData [get] |
Payload data. More... | |
Class representing a subsequent portion of MediaPacket. MediaContinuationPackets are used to transfer the data that remains after data worth first MTU is taken from the MediaPacket and costructed into a MediaHeaderPacket. The combination of a MediaHeaderPacket and the subsequent MediaContinuationPackets is a transfer sequence.
<author>Veli-Mikko Puupponen</author> This packet consist of a packet type identifier, sender GUID, a Int64 sequence number, packet count and packet number in the transfer sequence.
This packet must always have payload data.
Initializes a new MediaContinuationPacket with no parameters.
MediaContinuationPacket | ( | byte[] | guid, |
Int32 | packetOrderNumber, | ||
Int32 | packetCount, | ||
byte[] | payload, | ||
Int64 | sequenceNumber | ||
) |
Initializes a new MediaContinuationPacket instance that has the specified source Guid, packet order number, packet count, payload data and sequence number.
The first continuation packet in a network level transfer sequence always has packetOrderNumber = 1.
guid | String representation of the sender's Guid |
packetOrderNumber | Number of the this packet in the transfer sequence |
packetCount | Total count of packets in the transfer sequence |
payload | Payload data for this packet |
sequenceNumber | Sequence number for this packet. Must not vary within a transfer sequence |
MediaContinuationPacket | ( | byte[] | guid, |
Int32 | packetOrderNumber, | ||
Int32 | packetCount, | ||
byte[] | payload | ||
) |
Initializes a new MediaContinuationPacket instance that has the specified source Guid, packet order number, packet count and payload data. The sequence number must be provided prior any calls to the parameterless GetBytes.
The first continuation packet in a network level transfer sequence always has packetOrderNumber = 1.
guid | String representation of the sender's Guid |
packetOrderNumber | Number of the this packet in the transfer sequence |
packetCount | Total count of packets in the transfer sequence |
payload | Payload data for this packet |
void FromBytes | ( | byte[] | packetBytes | ) |
Sets the state of this packet from the provided array of bytes. If the array does not containt a valid byte representation of this type of packet, throws an ArgumentException.
Throws an ArgumentException if the provided array does not containt a valid byte repsentation of the packet type.
packetBytes | Byte representation of a packet with the same type as this packet |
Implements INetworkPacket.
byte [] GetBytes | ( | ) |
Converts this packet to a byte array for network transfer. The sequence number specified in the packet will be used.
Throws an ArgumentException if the packet is not in a properly initializes state.
Implements INetworkPacket.
|
get |
Number of this packet in the related transfer sequence.
|
get |
Payload data.
|
getset |
Packet sequence number
|
get |
String represenstation of the Guid identifying the sender
|
get |
Total number of packets in the related transfer sequence.