Halyri - Udp-client
0.9.1
|
Class representing a user-level media packet. This packet is used when receiving and sending media using the UdpMediaClientSocket. Encapsulates the complete media data and media type information. Can provide a collection of NetworkPackets conforming to the network MTU for network transfer. Can later be reconstructed from such packets at the receiving end. More...
Public Member Functions | |
MediaPacket (MediaInformation mediaInfo, byte[] mediaPayload, Int64 sequenceNumber, string guid) | |
Instantializes a new MediaPacket with the specified media information, payload data, sender Guid and sequence number. More... | |
MediaPacket (MediaInformation mediaInfo, byte[] mediaPayload, string guid, Int32 originatingLength, Int64 sequenceNumber) | |
Instantializes a new MediaPacket with the specified media information, payload data, sender Guid, original data length and sequence number. More... | |
MediaPacket (MediaInformation mediaInfo, byte[] mediaPayload, string guid, Int32 originatingLength) | |
Instantializes a new MediaPacket with the specified media information, payload data, sender Guid and original data length. More... | |
MediaPacket (MediaInformation mediaInfo, byte[] mediaPayload, string guid) | |
Instantializes a new MediaPacket with the specified media information, payload data and sender Guid. More... | |
MediaPacket (MediaHeaderPacket newHeaderPacket) | |
Instantializes a new MediaPacket using the MediaHeaderPacket from a network transfer packet sequence. If MediaPacket from which the MediaHeaderPacket was derived had no more than one network MTU of payload data, this MediaPacket instance is now complete (HasAllContinuationPackets = true). More... | |
MediaPacket (MediaContinuationPacket oneContinuationPacket) | |
/// More... | |
bool | AddHeaderPacket (MediaHeaderPacket newHeaderPacket) |
Adds a header packet to this MediaPacket. If there already is a header packet in this instance, returns the HasAllContinuationPackets indicating if some continuation packets are missing. More... | |
bool | AddContinuationPacket (MediaContinuationPacket continuationPacket) |
Adds a MediaContinuationPacket to this MediaPacket. Returns a boolean indicaing if all MediaContinuationPackets necessary to complete this MediaPacket have now been added. More... | |
INetworkPacket[] | GetAllTransmissionPackets (int mtu) |
Converts this MediaPacket into a collection of NetworkPackets for network transfer. All resulting networkPackets will have a byte representation with length no more that the specified MTU. More... | |
Properties | |
Int32 | OriginatingDataLength [get] |
Original length of the data prior to encoding into the specified transfer format. More... | |
Int64 | Sequence [get, set] |
Sequence number of this packet More... | |
bool | HasAllContinuationPackets [get] |
True, if not reconstructed from a network packet sequence or hass all packets from the relevant sequence. False otherwise. More... | |
bool | PayloadLengthMismatched [get] |
True, if reconstructed from a network packet sequence and one or more subpackets had an unexpected payload data length. Otherwise false. More... | |
string | SenderGuid [get] |
String represenstation of the Guid identifying the sender More... | |
DateTime | InitializationTime [get] |
DateTime of the instantialization time for this instance. More... | |
byte[] | CompletePayloadData [get] |
Complete payload data for this instance More... | |
MediaInformation | PacketMediaInformation [get] |
MediaInformation describing the media in this instance. Can be null on a packet constructed from a subpacket transfer sequence. More... | |
Class representing a user-level media packet. This packet is used when receiving and sending media using the UdpMediaClientSocket. Encapsulates the complete media data and media type information. Can provide a collection of NetworkPackets conforming to the network MTU for network transfer. Can later be reconstructed from such packets at the receiving end.
<author>Veli-Mikko Puupponen</author>
MediaPacket | ( | MediaInformation | mediaInfo, |
byte[] | mediaPayload, | ||
Int64 | sequenceNumber, | ||
string | guid | ||
) |
Instantializes a new MediaPacket with the specified media information, payload data, sender Guid and sequence number.
Throws an ArgumentException if any of the arguments is null or the payload data length is zero.
mediaInfo | MediaInformation instance describing the data contained in this instance |
mediaPayload | Media data |
sequenceNumber | Sequence number for all subpackets generated from this packet during network transmission |
guid | String representation of the sender's Guid |
MediaPacket | ( | MediaInformation | mediaInfo, |
byte[] | mediaPayload, | ||
string | guid, | ||
Int32 | originatingLength, | ||
Int64 | sequenceNumber | ||
) |
Instantializes a new MediaPacket with the specified media information, payload data, sender Guid, original data length and sequence number.
Throws an ArgumentException if any of the arguments is null or the payload data length is zero.
mediaInfo | MediaInformation instance describing the data contained in this instance |
mediaPayload | Media data |
guid | String representation of the sender's Guid |
originatingLength | Original length of the data prior to encoding into the specified transfer format. |
sequenceNumber | Sequence number for all subpackets generated from this packet during network transmission |
MediaPacket | ( | MediaInformation | mediaInfo, |
byte[] | mediaPayload, | ||
string | guid, | ||
Int32 | originatingLength | ||
) |
Instantializes a new MediaPacket with the specified media information, payload data, sender Guid and original data length.
Throws an ArgumentException if any of the arguments is null or the payload data length is zero.
mediaInfo | MediaInformation instance describing the data contained in this instance |
mediaPayload | Media data |
guid | String representation of the sender's Guid |
originatingLength | Original length of the data prior to encoding into the specified transfer format. |
MediaPacket | ( | MediaInformation | mediaInfo, |
byte[] | mediaPayload, | ||
string | guid | ||
) |
Instantializes a new MediaPacket with the specified media information, payload data and sender Guid.
Throws an ArgumentException if any of the arguments is null, the payload data length is zero or the Guid format is incorrect.
mediaInfo | MediaInformation instance describing the data contained in this instance |
mediaPayload | Media data |
guid | String representation of the sender's Guid |
MediaPacket | ( | MediaHeaderPacket | newHeaderPacket | ) |
Instantializes a new MediaPacket using the MediaHeaderPacket from a network transfer packet sequence. If MediaPacket from which the MediaHeaderPacket was derived had no more than one network MTU of payload data, this MediaPacket instance is now complete (HasAllContinuationPackets = true).
Otherwise the MediaContinuationPackets from the transfer sequence need to be added to this instace using the method AddContinuationPacket.
Throws an ArgumentException if the MediaHeaderPacket is not valid.
newHeaderPacket | MediaHeaderPacket instance |
MediaPacket | ( | MediaContinuationPacket | oneContinuationPacket | ) |
///
Instantializes a new MediaPacket using any MediaContinuationPacket from a network transfer packet sequence. All MediaPackets require at least the MediaHeaderPacket from the relevant packet sequence generated from the original MediaPacket. Therefore this MediaPacket will not be complete until at least the MediaHeaderPacket has been added using the method AddHeaderPacket.
Otherwise the MediaContinuationPackets from the transfer sequence need to be added to this instace using the method AddContinuationPacket.
Throws an ArgumentException if the MediaHeaderPacket is not valid.
oneContinuationPacket |
bool AddContinuationPacket | ( | MediaContinuationPacket | continuationPacket | ) |
Adds a MediaContinuationPacket to this MediaPacket. Returns a boolean indicaing if all MediaContinuationPackets necessary to complete this MediaPacket have now been added.
Throws an ArgumentException if the MediaContinuationPacket is not valid or has a mismatching sequence number or guid.
continuationPacket | MediaContinuationPacket that is a part of the related transfer packet sequence |
bool AddHeaderPacket | ( | MediaHeaderPacket | newHeaderPacket | ) |
Adds a header packet to this MediaPacket. If there already is a header packet in this instance, returns the HasAllContinuationPackets indicating if some continuation packets are missing.
If the MediaHeaderPacket is valid for this instance and no MediaContinuationPackets are missing, returns true indicating that this instance is now complete.
Throws an ArgumentException if the MediaHeaderPacket is not valid or has a mismatching sequence number or guid.
newHeaderPacket | Header packet for supplying first part of payload data and overall information to this instance. |
INetworkPacket [] GetAllTransmissionPackets | ( | int | mtu | ) |
Converts this MediaPacket into a collection of NetworkPackets for network transfer. All resulting networkPackets will have a byte representation with length no more that the specified MTU.
The MTU has to be 100 bytes or more. Throws an ArgumentException if MTU < 100.
mtu | Maximal network transmission unit size used to limit the resulting NetworkPacket payload sizes |
|
get |
Complete payload data for this instance
|
get |
True, if not reconstructed from a network packet sequence or hass all packets from the relevant sequence. False otherwise.
|
get |
DateTime of the instantialization time for this instance.
|
get |
Original length of the data prior to encoding into the specified transfer format.
|
get |
MediaInformation describing the media in this instance. Can be null on a packet constructed from a subpacket transfer sequence.
|
get |
True, if reconstructed from a network packet sequence and one or more subpackets had an unexpected payload data length. Otherwise false.
|
get |
String represenstation of the Guid identifying the sender
|
getset |
Sequence number of this packet