Halyri - Udp-client  0.9.1
 All Classes Namespaces Functions Enumerations Properties
INetworkPacket Interface Reference

Interface representing a network level packet. Exposes methods for converting the packet from and to a byte array representation for network transfer. More...

Inherited by ControlPacket, MediaContinuationPacket, MediaHeaderPacket, and PingPacket.

Public Member Functions

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...
 
byte[] GetBytes ()
 Converts this packet to a byte array for network transfer. The sequence number specified in the packet will be used. More...
 
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...
 

Detailed Description

Interface representing a network level packet. Exposes methods for converting the packet from and to a byte array representation for network transfer.

<author>Veli-Mikko Puupponen</author>

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

Implemented in MediaHeaderPacket, ControlPacket, MediaContinuationPacket, and PingPacket.

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.

Throws an ArgumentException if the packet is not in a properly initializes state.

Parameters
sequencePacket sequence number for the transfer header
Returns
A byte array containing data and transfer header for this packet
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

Implemented in ControlPacket, MediaHeaderPacket, MediaContinuationPacket, and PingPacket.


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