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

Class representing a ping packet for the protocol defined and implement by the UdpMediaClientSocket. This packet consist of a packet type identifier, sender GUID and a Int64 sequence number. More...

Inherits INetworkPacket.

Public Member Functions

 PingPacket ()
 Initializes a new ping packet with no information. More...
 
 PingPacket (string guid, Int64 sequenceNumber)
 Initializes a new ping packet that has the provided sequence number and sender GUID. More...
 
 PingPacket (string guid)
 Initializes a new ping packet that has the provided sender GUID. 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 = 25
 
const byte PacketId = 3
 

Properties

string SourceGuid [get]
 String represenstation of the Guid identifying the sender More...
 
Int64 Sequence [get, set]
 Packet sequence number More...
 

Detailed Description

Class representing a ping packet for the protocol defined and implement by the UdpMediaClientSocket. This packet consist of a packet type identifier, sender GUID and a Int64 sequence number.

<author>Veli-Mikko Puupponen</author>

Constructor & Destructor Documentation

Initializes a new ping packet with no information.

PingPacket ( string  guid,
Int64  sequenceNumber 
)

Initializes a new ping packet that has the provided sequence number and sender GUID.

Parameters
guidGuid of the sender
sequenceNumberPacket sequence number
PingPacket ( string  guid)

Initializes a new ping packet that has the provided sender GUID.

Parameters
guidGuid of the sender

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

Int64 Sequence
getset

Packet sequence number

string SourceGuid
get

String represenstation of the Guid identifying the sender


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