Halyri - Udp-client  0.9.1
 All Classes Namespaces Functions Enumerations Properties
MediaContinuationPacket Class Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Parameters
guidString representation of the sender's Guid
packetOrderNumberNumber of the this packet in the transfer sequence
packetCountTotal count of packets in the transfer sequence
payloadPayload data for this packet
sequenceNumberSequence 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.

Parameters
guidString representation of the sender's Guid
packetOrderNumberNumber of the this packet in the transfer sequence
packetCountTotal count of packets in the transfer sequence
payloadPayload data for this packet

Member Function Documentation

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.

Parameters
packetBytesByte 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.

Returns
A byte array containing data and transfer header for this packet

Implements INetworkPacket.

Property Documentation

Int32 PacketNumber
get

Number of this packet in the related transfer sequence.

byte [] PayloadData
get

Payload data.

Int64 Sequence
getset

Packet sequence number

string SourceGuid
get

String represenstation of the Guid identifying the sender

Int32 TotalPacketCount
get

Total number of packets in the related transfer sequence.


The documentation for this class was generated from the following file: