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

Class representing media information and payload data up to one network MTU in length from a MediaPacket. MediaHeaderPackets are used to transfer a portion of payload data and the media information from a MediaPacket. The combination of a MediaHeaderPacket and the subsequent MediaContinuationPackets is a transfer sequence. More...

Inherits INetworkPacket.

Public Member Functions

 MediaHeaderPacket ()
 Initializes a new MediaHeaderPacket instance with no parameters. More...
 
 MediaHeaderPacket (byte[] guid, Int16 mediaTypeIdentifier, Int16 mediaTransferCompressioIdentifier, Int32 packetCount, Int32 totalPayloadDataLength, Int32 originatingDataLength, byte[] payload, Int64 sequenceNumber)
 Initializes a new MediaHeaderPacket instance that has the specified source Guid, media type identified, media transfer compression identified, packet count, total payload data length, originating data length, sequence number and payload data More...
 
 MediaHeaderPacket (byte[] guid, Int16 mediaTypeIdentifier, Int16 mediaTransferCompressioIdentifier, Int32 packetCount, Int32 totalPayloadDataLength, Int32 originatingDataLength, byte[] payload)
 Initializes a new MediaHeaderPacket instance that has the specified source Guid, media type identified, media transfer compression identified, packet count, total payload data length, originating data length and payload data 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 = 41
 
const byte PacketId = 0
 

Properties

string SourceGuid [get]
 String represenstation of the Guid identifying the sender More...
 
Int64 Sequence [get, set]
 Sequence number of this packet More...
 
Int32 TotalPacketCount [get]
 Total count of packets in the related transfer sequence. More...
 
Int32 TotalPayloadDataLength [get]
 Total length of payload data in the related transfer sequence. More...
 
Int32 OriginatingDataLength [get]
 Original length of the data prior to encoding into the transfer format. More...
 
Int16 MediaFormat [get]
 Format of media in this packet. More...
 
Int16 MediaTransferCompression [get]
 Compression format of media in this packet More...
 
byte[] PayloadData [get]
 Payload data in this packet More...
 

Detailed Description

Class representing media information and payload data up to one network MTU in length from a MediaPacket. MediaHeaderPackets are used to transfer a portion of payload data and the media information from a MediaPacket. 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, media type identifier, media compression identified, payload data length and originating data length.

This packet must always have payload data. If the payload data length is smaller than network MTU, there transfer sequence can consist of only a single MediaHeaderPacket.

Constructor & Destructor Documentation

Initializes a new MediaHeaderPacket instance with no parameters.

MediaHeaderPacket ( byte[]  guid,
Int16  mediaTypeIdentifier,
Int16  mediaTransferCompressioIdentifier,
Int32  packetCount,
Int32  totalPayloadDataLength,
Int32  originatingDataLength,
byte[]  payload,
Int64  sequenceNumber 
)

Initializes a new MediaHeaderPacket instance that has the specified source Guid, media type identified, media transfer compression identified, packet count, total payload data length, originating data length, sequence number and payload data

Parameters
guidString representation of the sender's Guid
mediaTypeIdentifierPayload media type
mediaTransferCompressioIdentifierPayload media transfer compression type
packetCountTotal count of packets in the related trasfer sequence
totalPayloadDataLengthTotal number of payload octets in the complete related trasfer sequence
originatingDataLengthOriginal length of the data before encoding into the transfer format
payloadPayload data in this packet
sequenceNumberSequence number for this packet. Must not vary within a transfer sequence
MediaHeaderPacket ( byte[]  guid,
Int16  mediaTypeIdentifier,
Int16  mediaTransferCompressioIdentifier,
Int32  packetCount,
Int32  totalPayloadDataLength,
Int32  originatingDataLength,
byte[]  payload 
)

Initializes a new MediaHeaderPacket instance that has the specified source Guid, media type identified, media transfer compression identified, packet count, total payload data length, originating data length and payload data

The sequence number must be provided prior any calls to the parameterless GetBytes.

Parameters
guidString representation of the sender's Guid
mediaTypeIdentifierPayload media type
mediaTransferCompressioIdentifierPayload media transfer compression type
packetCountTotal count of packets in the related trasfer sequence
totalPayloadDataLengthTotal number of payload octets in the complete related trasfer sequence
originatingDataLengthOriginal length of the data before encoding into the transfer format
payloadPayload data in 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

Int16 MediaFormat
get

Format of media in this packet.

Int16 MediaTransferCompression
get

Compression format of media in this packet

Int32 OriginatingDataLength
get

Original length of the data prior to encoding into the transfer format.

byte [] PayloadData
get

Payload data in this packet

Int64 Sequence
getset

Sequence number of this packet

string SourceGuid
get

String represenstation of the Guid identifying the sender

Int32 TotalPacketCount
get

Total count of packets in the related transfer sequence.

Int32 TotalPayloadDataLength
get

Total length of payload data in the related transfer sequence.


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