Halyri - Udp-client
0.9.1
|
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... | |
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>
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 |
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.
sequence | Packet sequence number for the transfer header |
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.
Implemented in ControlPacket, MediaHeaderPacket, MediaContinuationPacket, and PingPacket.